├── .gitignore ├── FreeRDP ├── include │ ├── freerdp │ │ ├── addin.h │ │ ├── altsec.h │ │ ├── api.h │ │ ├── assistance.h │ │ ├── autodetect.h │ │ ├── build-config.h │ │ ├── cache │ │ │ ├── bitmap.h │ │ │ ├── brush.h │ │ │ ├── cache.h │ │ │ ├── glyph.h │ │ │ ├── nine_grid.h │ │ │ ├── offscreen.h │ │ │ ├── palette.h │ │ │ └── pointer.h │ │ ├── channels │ │ │ ├── audin.h │ │ │ ├── channels.h │ │ │ ├── cliprdr.h │ │ │ ├── encomsp.h │ │ │ ├── log.h │ │ │ ├── rail.h │ │ │ ├── rdpdr.h │ │ │ ├── rdpei.h │ │ │ ├── rdpgfx.h │ │ │ ├── rdpsnd.h │ │ │ ├── remdesk.h │ │ │ ├── tsmf.h │ │ │ └── wtsvc.h │ │ ├── client.h │ │ ├── client │ │ │ ├── audin.h │ │ │ ├── channels.h │ │ │ ├── cliprdr.h │ │ │ ├── cmdline.h │ │ │ ├── disp.h │ │ │ ├── drdynvc.h │ │ │ ├── encomsp.h │ │ │ ├── file.h │ │ │ ├── rail.h │ │ │ ├── rdpei.h │ │ │ ├── rdpgfx.h │ │ │ ├── rdpsnd.h │ │ │ ├── remdesk.h │ │ │ └── tsmf.h │ │ ├── codec │ │ │ ├── audio.h │ │ │ ├── bitmap.h │ │ │ ├── bulk.h │ │ │ ├── clear.h │ │ │ ├── color.h │ │ │ ├── dsp.h │ │ │ ├── h264.h │ │ │ ├── interleaved.h │ │ │ ├── jpeg.h │ │ │ ├── mppc.h │ │ │ ├── ncrush.h │ │ │ ├── nsc.h │ │ │ ├── planar.h │ │ │ ├── progressive.h │ │ │ ├── region.h │ │ │ ├── rfx.h │ │ │ ├── xcrush.h │ │ │ └── zgfx.h │ │ ├── codecs.h │ │ ├── constants.h │ │ ├── crypto │ │ │ ├── ber.h │ │ │ ├── certificate.h │ │ │ ├── crypto.h │ │ │ ├── der.h │ │ │ ├── er.h │ │ │ ├── per.h │ │ │ └── tls.h │ │ ├── dvc.h │ │ ├── error.h │ │ ├── event.h │ │ ├── extension.h │ │ ├── freerdp.h │ │ ├── gdi │ │ │ ├── 16bpp.h │ │ │ ├── 32bpp.h │ │ │ ├── 8bpp.h │ │ │ ├── bitmap.h │ │ │ ├── brush.h │ │ │ ├── clipping.h │ │ │ ├── dc.h │ │ │ ├── drawing.h │ │ │ ├── gdi.h │ │ │ ├── gfx.h │ │ │ ├── line.h │ │ │ ├── palette.h │ │ │ ├── pen.h │ │ │ ├── region.h │ │ │ └── shape.h │ │ ├── graphics.h │ │ ├── input.h │ │ ├── listener.h │ │ ├── locale │ │ │ ├── keyboard.h │ │ │ └── locale.h │ │ ├── log.h │ │ ├── message.h │ │ ├── metrics.h │ │ ├── peer.h │ │ ├── pointer.h │ │ ├── primary.h │ │ ├── primitives.h │ │ ├── rail.h │ │ ├── scancode.h │ │ ├── secondary.h │ │ ├── server │ │ │ ├── audin.h │ │ │ ├── channels.h │ │ │ ├── cliprdr.h │ │ │ ├── drdynvc.h │ │ │ ├── echo.h │ │ │ ├── encomsp.h │ │ │ ├── rdpdr.h │ │ │ ├── rdpei.h │ │ │ ├── rdpsnd.h │ │ │ ├── remdesk.h │ │ │ └── shadow.h │ │ ├── session.h │ │ ├── settings.h │ │ ├── svc.h │ │ ├── types.h │ │ ├── update.h │ │ ├── utils │ │ │ ├── msusb.h │ │ │ ├── passphrase.h │ │ │ ├── pcap.h │ │ │ ├── profiler.h │ │ │ ├── ringbuffer.h │ │ │ ├── signal.h │ │ │ └── stopwatch.h │ │ ├── version.h │ │ └── window.h │ └── winpr │ │ ├── asn1.h │ │ ├── bcrypt.h │ │ ├── bitstream.h │ │ ├── clipboard.h │ │ ├── cmdline.h │ │ ├── collections.h │ │ ├── comm.h │ │ ├── credentials.h │ │ ├── credui.h │ │ ├── crt.h │ │ ├── crypto.h │ │ ├── debug.h │ │ ├── dsparse.h │ │ ├── endian.h │ │ ├── environment.h │ │ ├── error.h │ │ ├── file.h │ │ ├── handle.h │ │ ├── heap.h │ │ ├── image.h │ │ ├── ini.h │ │ ├── input.h │ │ ├── interlocked.h │ │ ├── intrin.h │ │ ├── io.h │ │ ├── library.h │ │ ├── locale.h │ │ ├── memory.h │ │ ├── midl.h │ │ ├── ndr.h │ │ ├── nt.h │ │ ├── ntlm.h │ │ ├── pack.h │ │ ├── path.h │ │ ├── pipe.h │ │ ├── platform.h │ │ ├── pool.h │ │ ├── print.h │ │ ├── registry.h │ │ ├── rpc.h │ │ ├── sam.h │ │ ├── schannel.h │ │ ├── security.h │ │ ├── shell.h │ │ ├── smartcard.h │ │ ├── spec.h │ │ ├── ssl.h │ │ ├── sspi.h │ │ ├── sspicli.h │ │ ├── stream.h │ │ ├── string.h │ │ ├── synch.h │ │ ├── sysinfo.h │ │ ├── tchar.h │ │ ├── thread.h │ │ ├── timezone.h │ │ ├── tools │ │ └── makecert.h │ │ ├── user.h │ │ ├── version.h │ │ ├── windows.h │ │ ├── winhttp.h │ │ ├── winpr.h │ │ ├── winsock.h │ │ ├── wlog.h │ │ ├── wnd.h │ │ ├── wtsapi.h │ │ └── wtypes.h └── lib │ ├── libfreerdp-client.so │ ├── libfreerdp-client.so.2 │ ├── libfreerdp.so │ ├── libfreerdp.so.2 │ ├── libwinpr.so │ └── libwinpr.so.1 ├── README.md ├── build.sh ├── index.html ├── nginx ├── mime.types └── nginx.conf ├── rdp.go ├── rdp_bitmap.go ├── rdp_event.go ├── rdp_gdi.go ├── rdprw.go ├── webrdp.h └── wsrdp.go /.gitignore: -------------------------------------------------------------------------------- 1 | webRDP 2 | tmp/ 3 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/addin.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Addin Loader 4 | * 5 | * Copyright 2012 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_COMMON_ADDIN_H 21 | #define FREERDP_COMMON_ADDIN_H 22 | 23 | #include 24 | #include 25 | 26 | #define FREERDP_ADDIN_CLIENT 0x00000001 27 | #define FREERDP_ADDIN_SERVER 0x00000002 28 | 29 | #define FREERDP_ADDIN_STATIC 0x00000010 30 | #define FREERDP_ADDIN_DYNAMIC 0x00000020 31 | 32 | #define FREERDP_ADDIN_NAME 0x00000100 33 | #define FREERDP_ADDIN_SUBSYSTEM 0x00000200 34 | #define FREERDP_ADDIN_TYPE 0x00000400 35 | 36 | #define FREERDP_ADDIN_CHANNEL_STATIC 0x00001000 37 | #define FREERDP_ADDIN_CHANNEL_DYNAMIC 0x00002000 38 | #define FREERDP_ADDIN_CHANNEL_DEVICE 0x00004000 39 | 40 | struct _FREERDP_ADDIN 41 | { 42 | DWORD dwFlags; 43 | CHAR cName[16]; 44 | CHAR cType[16]; 45 | CHAR cSubsystem[16]; 46 | }; 47 | typedef struct _FREERDP_ADDIN FREERDP_ADDIN; 48 | 49 | typedef void* (*FREERDP_LOAD_CHANNEL_ADDIN_ENTRY_FN)(LPCSTR pszName, LPSTR pszSubsystem, LPSTR pszType, DWORD dwFlags); 50 | 51 | #ifdef __cplusplus 52 | extern "C" { 53 | #endif 54 | 55 | FREERDP_API LPSTR freerdp_get_library_install_path(void); 56 | FREERDP_API LPSTR freerdp_get_dynamic_addin_install_path(void); 57 | 58 | FREERDP_API int freerdp_register_addin_provider(FREERDP_LOAD_CHANNEL_ADDIN_ENTRY_FN provider, DWORD dwFlags); 59 | 60 | FREERDP_API void* freerdp_load_dynamic_addin(LPCSTR pszFileName, LPCSTR pszPath, LPCSTR pszEntryName); 61 | FREERDP_API void* freerdp_load_dynamic_channel_addin_entry(LPCSTR pszName, LPSTR pszSubsystem, LPSTR pszType, DWORD dwFlags); 62 | FREERDP_API void* freerdp_load_channel_addin_entry(LPCSTR pszName, LPSTR pszSubsystem, LPSTR pszType, DWORD dwFlags); 63 | 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | 68 | #endif /* FREERDP_COMMON_ADDIN_H */ 69 | 70 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/api.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * FreeRDP Interface 4 | * 5 | * Copyright 2009-2011 Jay Sorg 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_API_H 21 | #define FREERDP_API_H 22 | 23 | #ifdef _WIN32 24 | #define FREERDP_CC __cdecl 25 | #else 26 | #define FREERDP_CC 27 | #endif 28 | 29 | #ifdef _WIN32 30 | #define INLINE __inline 31 | #else 32 | #define INLINE inline 33 | #endif 34 | 35 | #ifdef _WIN32 36 | #define __func__ __FUNCTION__ 37 | #endif 38 | 39 | #if defined _WIN32 || defined __CYGWIN__ 40 | #ifdef FREERDP_EXPORTS 41 | #ifdef __GNUC__ 42 | #define FREERDP_API __attribute__((dllexport)) 43 | #else 44 | #define FREERDP_API __declspec(dllexport) 45 | #endif 46 | #else 47 | #ifdef __GNUC__ 48 | #define FREERDP_API __attribute__((dllimport)) 49 | #else 50 | #define FREERDP_API __declspec(dllimport) 51 | #endif 52 | #endif 53 | #else 54 | #if __GNUC__ >= 4 55 | #define FREERDP_API __attribute__ ((visibility("default"))) 56 | #else 57 | #define FREERDP_API 58 | #endif 59 | #endif 60 | 61 | #ifdef FREERDP_TEST_EXPORTS 62 | #define FREERDP_TEST_API FREERDP_API 63 | #else 64 | #define FREERDP_TEST_API 65 | #endif 66 | 67 | #define IFCALL(_cb, ...) do { if (_cb != NULL) { _cb( __VA_ARGS__ ); } } while (0) 68 | #define IFCALLRET(_cb, _ret, ...) do { if (_cb != NULL) { _ret = _cb( __VA_ARGS__ ); } } while (0) 69 | #define IFCALLRESULT(_default_return, _cb, ...) (_cb != NULL) ? _cb( __VA_ARGS__ ) : (_default_return) 70 | 71 | #endif /* FREERDP_API */ 72 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/assistance.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Remote Assistance 4 | * 5 | * Copyright 2014 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_REMOTE_ASSISTANCE_H 21 | #define FREERDP_REMOTE_ASSISTANCE_H 22 | 23 | #include 24 | #include 25 | 26 | struct rdp_assistance_file 27 | { 28 | UINT32 Type; 29 | 30 | char* Username; 31 | char* LHTicket; 32 | char* RCTicket; 33 | char* PassStub; 34 | UINT32 DtStart; 35 | UINT32 DtLength; 36 | BOOL LowSpeed; 37 | BOOL RCTicketEncrypted; 38 | 39 | char* ConnectionString1; 40 | char* ConnectionString2; 41 | 42 | BYTE* EncryptedPassStub; 43 | int EncryptedPassStubLength; 44 | 45 | BYTE* EncryptedLHTicket; 46 | int EncryptedLHTicketLength; 47 | 48 | char* MachineAddress; 49 | UINT32 MachinePort; 50 | 51 | UINT32 MachineCount; 52 | char** MachineAddresses; 53 | UINT32* MachinePorts; 54 | 55 | char* RASessionId; 56 | char* RASpecificParams; 57 | }; 58 | typedef struct rdp_assistance_file rdpAssistanceFile; 59 | 60 | #ifdef __cplusplus 61 | extern "C" { 62 | #endif 63 | 64 | FREERDP_API BYTE* freerdp_assistance_hex_string_to_bin(const char* str, int* size); 65 | FREERDP_API char* freerdp_assistance_bin_to_hex_string(const BYTE* data, int size); 66 | 67 | FREERDP_API int freerdp_assistance_parse_connection_string1(rdpAssistanceFile* file); 68 | FREERDP_API int freerdp_assistance_parse_connection_string2(rdpAssistanceFile* file); 69 | 70 | FREERDP_API char* freerdp_assistance_generate_pass_stub(DWORD flags); 71 | FREERDP_API char* freerdp_assistance_construct_expert_blob(const char* name, const char* pass); 72 | FREERDP_API BYTE* freerdp_assistance_encrypt_pass_stub(const char* password, const char* passStub, int* pEncryptedSize); 73 | 74 | FREERDP_API int freerdp_assistance_parse_file_buffer(rdpAssistanceFile* file, const char* buffer, size_t size); 75 | FREERDP_API int freerdp_assistance_parse_file(rdpAssistanceFile* file, const char* name); 76 | FREERDP_API int freerdp_assistance_decrypt(rdpAssistanceFile* file, const char* password); 77 | 78 | FREERDP_API int freerdp_client_populate_settings_from_assistance_file(rdpAssistanceFile* file, rdpSettings* settings); 79 | 80 | FREERDP_API rdpAssistanceFile* freerdp_assistance_file_new(void); 81 | FREERDP_API void freerdp_assistance_file_free(rdpAssistanceFile* file); 82 | 83 | #ifdef __cplusplus 84 | } 85 | #endif 86 | 87 | #endif /* FREERDP_REMOTE_ASSISTANCE_H */ 88 | 89 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/autodetect.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Auto-Detect PDUs 4 | * 5 | * Copyright 2014 Dell Software 6 | * Copyright 2014 Vic Lee 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef FREERDP_AUTODETECT_H 22 | #define FREERDP_AUTODETECT_H 23 | 24 | typedef struct rdp_autodetect rdpAutoDetect; 25 | 26 | typedef BOOL (*pRTTMeasureRequest)(rdpContext* context, UINT16 sequenceNumber); 27 | typedef BOOL (*pRTTMeasureResponse)(rdpContext* context, UINT16 sequenceNumber); 28 | typedef BOOL (*pBandwidthMeasureStart)(rdpContext* context, UINT16 sequenceNumber); 29 | typedef BOOL (*pBandwidthMeasureStop)(rdpContext* context, UINT16 sequenceNumber); 30 | typedef BOOL (*pBandwidthMeasureResults)(rdpContext* context, UINT16 sequenceNumber); 31 | typedef BOOL (*pNetworkCharacteristicsResult)(rdpContext* context, UINT16 sequenceNumber); 32 | typedef BOOL (*pClientBandwidthMeasureResult)(rdpContext* context, rdpAutoDetect* data); 33 | 34 | struct rdp_autodetect 35 | { 36 | ALIGN64 rdpContext* context; /* 0 */ 37 | /* RTT measurement */ 38 | ALIGN64 UINT32 rttMeasureStartTime; /* 1 */ 39 | /* Bandwidth measurement */ 40 | ALIGN64 UINT32 bandwidthMeasureStartTime; /* 2 */ 41 | ALIGN64 UINT32 bandwidthMeasureTimeDelta; /* 3 */ 42 | ALIGN64 UINT32 bandwidthMeasureByteCount; /* 4 */ 43 | /* Network characteristics (as reported by server) */ 44 | ALIGN64 UINT32 netCharBandwidth; /* 5 */ 45 | ALIGN64 UINT32 netCharBaseRTT; /* 6 */ 46 | ALIGN64 UINT32 netCharAverageRTT; /* 7 */ 47 | ALIGN64 BOOL bandwidthMeasureStarted; /* 8 */ 48 | UINT64 paddingA[16 - 9]; /* 9 */ 49 | 50 | ALIGN64 pRTTMeasureRequest RTTMeasureRequest; /* 16 */ 51 | ALIGN64 pRTTMeasureResponse RTTMeasureResponse; /* 17 */ 52 | ALIGN64 pBandwidthMeasureStart BandwidthMeasureStart; /* 18 */ 53 | ALIGN64 pBandwidthMeasureStop BandwidthMeasureStop; /* 19 */ 54 | ALIGN64 pBandwidthMeasureResults BandwidthMeasureResults; /* 20 */ 55 | ALIGN64 pNetworkCharacteristicsResult NetworkCharacteristicsResult; /* 21 */ 56 | ALIGN64 pClientBandwidthMeasureResult ClientBandwidthMeasureResult; /* 22 */ 57 | UINT64 paddingB[32 - 23]; /* 23 */ 58 | }; 59 | 60 | 61 | #endif /* FREERDP_AUTODETECT_H */ 62 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/build-config.h: -------------------------------------------------------------------------------- 1 | #ifndef FREERDP_BUILD_CONFIG_H 2 | #define FREERDP_BUILD_CONFIG_H 3 | 4 | #define FREERDP_DATA_PATH "/usr/local/share/freerdp" 5 | #define FREERDP_KEYMAP_PATH "" 6 | #define FREERDP_PLUGIN_PATH "lib/x86_64-linux-gnu/freerdp" 7 | 8 | #define FREERDP_INSTALL_PREFIX "/usr/local" 9 | 10 | #define FREERDP_LIBRARY_PATH "lib/x86_64-linux-gnu" 11 | 12 | #define FREERDP_ADDIN_PATH "lib/x86_64-linux-gnu/freerdp" 13 | 14 | #define FREERDP_SHARED_LIBRARY_SUFFIX ".so" 15 | #define FREERDP_SHARED_LIBRARY_PREFIX "lib" 16 | 17 | #define FREERDP_VENDOR_STRING "FreeRDP" 18 | #define FREERDP_PRODUCT_STRING "FreeRDP" 19 | 20 | #endif /* FREERDP_BUILD_CONFIG_H */ 21 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/cache/bitmap.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Bitmap Cache V2 4 | * 5 | * Copyright 2011 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_BITMAP_V2_CACHE_H 21 | #define FREERDP_BITMAP_V2_CACHE_H 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #include 29 | 30 | typedef struct _BITMAP_V2_CELL BITMAP_V2_CELL; 31 | typedef struct rdp_bitmap_cache rdpBitmapCache; 32 | 33 | #include 34 | 35 | struct _BITMAP_V2_CELL 36 | { 37 | UINT32 number; 38 | rdpBitmap** entries; 39 | }; 40 | 41 | struct rdp_bitmap_cache 42 | { 43 | pMemBlt MemBlt; /* 0 */ 44 | pMem3Blt Mem3Blt; /* 1 */ 45 | pCacheBitmap CacheBitmap; /* 2 */ 46 | pCacheBitmapV2 CacheBitmapV2; /* 3 */ 47 | pCacheBitmapV3 CacheBitmapV3; /* 4 */ 48 | pBitmapUpdate BitmapUpdate; /* 5 */ 49 | UINT32 paddingA[16 - 6]; /* 6 */ 50 | 51 | UINT32 maxCells; /* 16 */ 52 | BITMAP_V2_CELL* cells; /* 17 */ 53 | UINT32 paddingB[32 - 18]; /* 18 */ 54 | 55 | /* internal */ 56 | 57 | rdpBitmap* bitmap; 58 | rdpUpdate* update; 59 | rdpContext* context; 60 | rdpSettings* settings; 61 | }; 62 | 63 | #ifdef __cplusplus 64 | extern "C" { 65 | #endif 66 | 67 | FREERDP_API rdpBitmap* bitmap_cache_get(rdpBitmapCache* bitmap_cache, UINT32 id, UINT32 index); 68 | FREERDP_API void bitmap_cache_put(rdpBitmapCache* bitmap_cache, UINT32 id, UINT32 index, rdpBitmap* bitmap); 69 | 70 | FREERDP_API void bitmap_cache_register_callbacks(rdpUpdate* update); 71 | 72 | FREERDP_API rdpBitmapCache* bitmap_cache_new(rdpSettings* settings); 73 | FREERDP_API void bitmap_cache_free(rdpBitmapCache* bitmap_cache); 74 | 75 | #ifdef __cplusplus 76 | } 77 | #endif 78 | 79 | #endif /* FREERDP_BITMAP_V2_CACHE_H */ 80 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/cache/brush.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Brush Cache 4 | * 5 | * Copyright 2011 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_BRUSH_CACHE_H 21 | #define FREERDP_BRUSH_CACHE_H 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #include 29 | 30 | typedef struct _BRUSH_ENTRY BRUSH_ENTRY; 31 | typedef struct rdp_brush_cache rdpBrushCache; 32 | 33 | #include 34 | 35 | struct _BRUSH_ENTRY 36 | { 37 | UINT32 bpp; 38 | void* entry; 39 | }; 40 | 41 | struct rdp_brush_cache 42 | { 43 | pPatBlt PatBlt; /* 0 */ 44 | pCacheBrush CacheBrush; /* 1 */ 45 | pPolygonSC PolygonSC; /* 2 */ 46 | pPolygonCB PolygonCB; /* 3 */ 47 | UINT32 paddingA[16 - 4]; /* 4 */ 48 | 49 | UINT32 maxEntries; /* 16 */ 50 | UINT32 maxMonoEntries; /* 17 */ 51 | BRUSH_ENTRY* entries; /* 18 */ 52 | BRUSH_ENTRY* monoEntries; /* 19 */ 53 | UINT32 paddingB[32 - 20]; /* 20 */ 54 | 55 | /* internal */ 56 | 57 | rdpSettings* settings; 58 | }; 59 | 60 | #ifdef __cplusplus 61 | extern "C" { 62 | #endif 63 | 64 | FREERDP_API void* brush_cache_get(rdpBrushCache* brush, UINT32 index, UINT32* bpp); 65 | FREERDP_API void brush_cache_put(rdpBrushCache* brush, UINT32 index, void* entry, UINT32 bpp); 66 | 67 | FREERDP_API void brush_cache_register_callbacks(rdpUpdate* update); 68 | 69 | FREERDP_API rdpBrushCache* brush_cache_new(rdpSettings* settings); 70 | FREERDP_API void brush_cache_free(rdpBrushCache* brush); 71 | 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | 76 | #endif /* FREERDP_BRUSH_CACHE_H */ 77 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/cache/cache.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * RDP Caches 4 | * 5 | * Copyright 2011 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_CACHE_H 21 | #define FREERDP_CACHE_H 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | struct rdp_cache 38 | { 39 | rdpGlyphCache* glyph; /* 0 */ 40 | rdpBrushCache* brush; /* 1 */ 41 | rdpPointerCache* pointer; /* 2 */ 42 | rdpBitmapCache* bitmap; /* 3 */ 43 | rdpOffscreenCache* offscreen; /* 4 */ 44 | rdpPaletteCache* palette; /* 5 */ 45 | rdpNineGridCache* nine_grid; /* 6 */ 46 | 47 | /* internal */ 48 | 49 | rdpSettings* settings; 50 | }; 51 | 52 | #ifdef __cplusplus 53 | extern "C" { 54 | #endif 55 | 56 | FREERDP_API rdpCache* cache_new(rdpSettings* settings); 57 | FREERDP_API void cache_free(rdpCache* cache); 58 | 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | 63 | #endif /* FREERDP_CACHE_H */ 64 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/cache/glyph.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Glyph Cache 4 | * 5 | * Copyright 2011 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_GLYPH_CACHE_H 21 | #define FREERDP_GLYPH_CACHE_H 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | #include 29 | 30 | typedef struct _GLYPH_CACHE GLYPH_CACHE; 31 | typedef struct _FRAGMENT_CACHE_ENTRY FRAGMENT_CACHE_ENTRY; 32 | typedef struct _FRAGMENT_CACHE FRAGMENT_CACHE; 33 | typedef struct rdp_glyph_cache rdpGlyphCache; 34 | 35 | #include 36 | 37 | struct _GLYPH_CACHE 38 | { 39 | UINT32 number; 40 | UINT32 maxCellSize; 41 | rdpGlyph** entries; 42 | }; 43 | 44 | struct _FRAGMENT_CACHE_ENTRY 45 | { 46 | void* fragment; 47 | UINT32 size; 48 | }; 49 | 50 | struct _FRAGMENT_CACHE 51 | { 52 | FRAGMENT_CACHE_ENTRY* entries; 53 | }; 54 | 55 | struct rdp_glyph_cache 56 | { 57 | FRAGMENT_CACHE fragCache; 58 | GLYPH_CACHE glyphCache[10]; 59 | 60 | wLog* log; 61 | rdpContext* context; 62 | rdpSettings* settings; 63 | }; 64 | 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | FREERDP_API rdpGlyph* glyph_cache_get(rdpGlyphCache* glyph_cache, UINT32 id, UINT32 index); 70 | FREERDP_API void glyph_cache_put(rdpGlyphCache* glyph_cache, UINT32 id, UINT32 index, rdpGlyph* entry); 71 | 72 | FREERDP_API void* glyph_cache_fragment_get(rdpGlyphCache* glyph, UINT32 index, UINT32* count); 73 | FREERDP_API void glyph_cache_fragment_put(rdpGlyphCache* glyph, UINT32 index, UINT32 count, void* entry); 74 | 75 | FREERDP_API void glyph_cache_register_callbacks(rdpUpdate* update); 76 | 77 | FREERDP_API rdpGlyphCache* glyph_cache_new(rdpSettings* settings); 78 | FREERDP_API void glyph_cache_free(rdpGlyphCache* glyph); 79 | 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | 84 | #endif /* FREERDP_GLYPH_CACHE_H */ 85 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/cache/nine_grid.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * NineGrid Cache 4 | * 5 | * Copyright 2012 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_NINE_GRID_CACHE_H 21 | #define FREERDP_NINE_GRID_CACHE_H 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #include 29 | 30 | typedef struct _NINE_GRID_ENTRY NINE_GRID_ENTRY; 31 | typedef struct rdp_nine_grid_cache rdpNineGridCache; 32 | 33 | #include 34 | 35 | struct _NINE_GRID_ENTRY 36 | { 37 | void* entry; 38 | }; 39 | 40 | struct rdp_nine_grid_cache 41 | { 42 | pDrawNineGrid DrawNineGrid; /* 0 */ 43 | pMultiDrawNineGrid MultiDrawNineGrid; /* 1 */ 44 | UINT32 paddingA[16 - 2]; /* 2 */ 45 | 46 | UINT32 maxEntries; /* 16 */ 47 | UINT32 maxSize; /* 17 */ 48 | NINE_GRID_ENTRY* entries; /* 18 */ 49 | UINT32 paddingB[32 - 19]; /* 19 */ 50 | 51 | /* internal */ 52 | 53 | rdpSettings* settings; 54 | }; 55 | 56 | #ifdef __cplusplus 57 | extern "C" { 58 | #endif 59 | 60 | FREERDP_API void* nine_grid_cache_get(rdpNineGridCache* nine_grid, UINT32 index); 61 | FREERDP_API void nine_grid_cache_put(rdpNineGridCache* nine_grid, UINT32 index, void* entry); 62 | 63 | FREERDP_API void nine_grid_cache_register_callbacks(rdpUpdate* update); 64 | 65 | FREERDP_API rdpNineGridCache* nine_grid_cache_new(rdpSettings* settings); 66 | FREERDP_API void nine_grid_cache_free(rdpNineGridCache* nine_grid); 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | 72 | #endif /* FREERDP_NINE_GRID_CACHE_H */ 73 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/cache/offscreen.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Offscreen Bitmap Cache 4 | * 5 | * Copyright 2011 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_OFFSCREEN_CACHE_H 21 | #define FREERDP_OFFSCREEN_CACHE_H 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #include 29 | 30 | typedef struct rdp_offscreen_cache rdpOffscreenCache; 31 | 32 | #include 33 | 34 | struct rdp_offscreen_cache 35 | { 36 | UINT32 maxSize; /* 0 */ 37 | UINT32 maxEntries; /* 1 */ 38 | rdpBitmap** entries; /* 2 */ 39 | UINT32 currentSurface; /* 3 */ 40 | 41 | /* internal */ 42 | 43 | rdpUpdate* update; 44 | rdpSettings* settings; 45 | }; 46 | 47 | #ifdef __cplusplus 48 | extern "C" { 49 | #endif 50 | 51 | FREERDP_API rdpBitmap* offscreen_cache_get(rdpOffscreenCache* offscreen_cache, UINT32 index); 52 | FREERDP_API void offscreen_cache_put(rdpOffscreenCache* offscreen_cache, UINT32 index, rdpBitmap* bitmap); 53 | FREERDP_API void offscreen_cache_delete(rdpOffscreenCache* offscreen, UINT32 index); 54 | 55 | FREERDP_API void offscreen_cache_register_callbacks(rdpUpdate* update); 56 | 57 | FREERDP_API rdpOffscreenCache* offscreen_cache_new(rdpSettings* settings); 58 | FREERDP_API void offscreen_cache_free(rdpOffscreenCache* offscreen); 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | 64 | #endif /* FREERDP_OFFSCREEN_CACHE_H */ 65 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/cache/palette.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Palette (Color Table) Cache 4 | * 5 | * Copyright 2011 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_PALETTE_CACHE_H 21 | #define FREERDP_PALETTE_CACHE_H 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #include 29 | 30 | typedef struct _PALETTE_TABLE_ENTRY PALETTE_TABLE_ENTRY; 31 | typedef struct rdp_palette_cache rdpPaletteCache; 32 | 33 | #include 34 | 35 | struct _PALETTE_TABLE_ENTRY 36 | { 37 | void* entry; 38 | }; 39 | 40 | struct rdp_palette_cache 41 | { 42 | UINT32 maxEntries; /* 0 */ 43 | PALETTE_TABLE_ENTRY* entries; /* 1 */ 44 | 45 | /* internal */ 46 | 47 | rdpSettings* settings; 48 | }; 49 | 50 | #ifdef __cplusplus 51 | extern "C" { 52 | #endif 53 | 54 | FREERDP_API void* palette_cache_get(rdpPaletteCache* palette, UINT32 index); 55 | FREERDP_API void palette_cache_put(rdpPaletteCache* palette, UINT32 index, void* entry); 56 | 57 | FREERDP_API void palette_cache_register_callbacks(rdpUpdate* update); 58 | 59 | FREERDP_API rdpPaletteCache* palette_cache_new(rdpSettings* settings); 60 | FREERDP_API void palette_cache_free(rdpPaletteCache* palette_cache); 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif /* FREERDP_PALETTE_CACHE_H */ 67 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/cache/pointer.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Pointer Cache 4 | * 5 | * Copyright 2011 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_POINTER_CACHE_H 21 | #define FREERDP_POINTER_CACHE_H 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | typedef struct rdp_pointer_cache rdpPointerCache; 32 | 33 | #include 34 | 35 | struct rdp_pointer_cache 36 | { 37 | UINT32 cacheSize; /* 0 */ 38 | rdpPointer** entries; /* 1 */ 39 | 40 | /* internal */ 41 | 42 | rdpUpdate* update; 43 | rdpSettings* settings; 44 | }; 45 | 46 | #ifdef __cplusplus 47 | extern "C" { 48 | #endif 49 | 50 | FREERDP_API rdpPointer* pointer_cache_get(rdpPointerCache* pointer_cache, UINT32 index); 51 | FREERDP_API void pointer_cache_put(rdpPointerCache* pointer_cache, UINT32 index, rdpPointer* pointer); 52 | 53 | FREERDP_API void pointer_cache_register_callbacks(rdpUpdate* update); 54 | 55 | FREERDP_API rdpPointerCache* pointer_cache_new(rdpSettings* settings); 56 | FREERDP_API void pointer_cache_free(rdpPointerCache* pointer_cache); 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif /* FREERDP_POINTER_CACHE_H */ 63 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/channels/audin.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Audio Input Redirection Virtual Channel 4 | * 5 | * Copyright 2010-2011 Vic Lee 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_CHANNEL_AUDIN_H 21 | #define FREERDP_CHANNEL_AUDIN_H 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | 28 | 29 | #endif /* FREERDP_CHANNEL_AUDIN_H */ 30 | 31 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/channels/channels.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Virtual Channel Manager 4 | * 5 | * Copyright 2009-2011 Jay Sorg 6 | * Copyright 2010-2011 Vic Lee 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef FREERDP_CHANNELS_H 22 | #define FREERDP_CHANNELS_H 23 | 24 | #include 25 | #include 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | FREERDP_API rdpChannels* freerdp_channels_new(void); 36 | FREERDP_API void freerdp_channels_free(rdpChannels* channels); 37 | FREERDP_API int freerdp_channels_client_load(rdpChannels* channels, rdpSettings* settings, 38 | PVIRTUALCHANNELENTRY entry, void* data); 39 | FREERDP_API int freerdp_channels_load_plugin(rdpChannels* channels, rdpSettings* settings, 40 | const char* name, void* data); 41 | FREERDP_API int freerdp_channels_pre_connect(rdpChannels* channels, freerdp* instance); 42 | FREERDP_API int freerdp_channels_post_connect(rdpChannels* channels, freerdp* instance); 43 | FREERDP_API int freerdp_channels_disconnect(rdpChannels* channels, freerdp* instance); 44 | FREERDP_API BOOL freerdp_channels_get_fds(rdpChannels* channels, freerdp* instance, void** read_fds, 45 | int* read_count, void** write_fds, int* write_count); 46 | FREERDP_API BOOL freerdp_channels_check_fds(rdpChannels* channels, freerdp* instance); 47 | FREERDP_API void freerdp_channels_close(rdpChannels* channels, freerdp* instance); 48 | 49 | FREERDP_API void* freerdp_channels_get_static_channel_interface(rdpChannels* channels, const char* name); 50 | 51 | FREERDP_API HANDLE freerdp_channels_get_event_handle(freerdp* instance); 52 | FREERDP_API int freerdp_channels_process_pending_messages(freerdp* instance); 53 | 54 | FREERDP_API int freerdp_channels_data(freerdp* instance, 55 | UINT16 channelId, BYTE* data, int dataSize, int flags, int totalSize); 56 | 57 | FREERDP_API PWtsApiFunctionTable FreeRDP_InitWtsApi(void); 58 | 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | 63 | #endif /* FREERDP_CHANNELS_H */ 64 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/channels/log.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Channel log defines 4 | * 5 | * Copyright 2014 Armin Novak 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_CHANNELS_LOG_H 21 | #define FREERDP_CHANNELS_LOG_H 22 | 23 | #include 24 | #include 25 | 26 | #define CHANNELS_TAG(tag) FREERDP_TAG("channels.") tag 27 | 28 | #endif /* FREERDP_UTILS_DEBUG_H */ 29 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/channels/rail.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Remote Applications Integrated Locally (RAIL) 4 | * 5 | * Copyright 2013 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_CHANNEL_RAIL_H 21 | #define FREERDP_CHANNEL_RAIL_H 22 | 23 | #include 24 | #include 25 | 26 | 27 | 28 | #endif /* FREERDP_CHANNEL_RAIL_H */ 29 | 30 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/channels/rdpei.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Extended Input channel common definitions 4 | * 5 | * Copyright 2013 Marc-Andre Moreau 6 | * Copyright 2014 Thincast Technologies Gmbh. 7 | * Copyright 2014 David FORT 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #ifndef __FREERDP_CHANNEL_RDPEI_H_ 23 | #define __FREERDP_CHANNEL_RDPEI_H_ 24 | 25 | #include 26 | 27 | #define RDPINPUT_HEADER_LENGTH 6 28 | 29 | #define RDPEI_DVC_CHANNEL_NAME "Microsoft::Windows::RDS::Input" 30 | 31 | /** @brief protocol version */ 32 | enum { 33 | RDPINPUT_PROTOCOL_V10 = 0x00010000, 34 | RDPINPUT_PROTOCOL_V101 = 0x00010001 35 | }; 36 | 37 | /* Client Ready Flags */ 38 | #define READY_FLAGS_SHOW_TOUCH_VISUALS 0x00000001 39 | #define READY_FLAGS_DISABLE_TIMESTAMP_INJECTION 0x00000002 40 | 41 | 42 | #define CONTACT_DATA_CONTACTRECT_PRESENT 0x0001 43 | #define CONTACT_DATA_ORIENTATION_PRESENT 0x0002 44 | #define CONTACT_DATA_PRESSURE_PRESENT 0x0004 45 | 46 | #define CONTACT_FLAG_DOWN 0x0001 47 | #define CONTACT_FLAG_UPDATE 0x0002 48 | #define CONTACT_FLAG_UP 0x0004 49 | #define CONTACT_FLAG_INRANGE 0x0008 50 | #define CONTACT_FLAG_INCONTACT 0x0010 51 | #define CONTACT_FLAG_CANCELED 0x0020 52 | 53 | /** @brief a contact point */ 54 | struct _RDPINPUT_CONTACT_DATA 55 | { 56 | UINT32 contactId; 57 | UINT32 fieldsPresent; 58 | INT32 x; 59 | INT32 y; 60 | UINT32 contactFlags; 61 | INT32 contactRectLeft; 62 | INT32 contactRectTop; 63 | INT32 contactRectRight; 64 | INT32 contactRectBottom; 65 | UINT32 orientation; 66 | UINT32 pressure; 67 | }; 68 | typedef struct _RDPINPUT_CONTACT_DATA RDPINPUT_CONTACT_DATA; 69 | 70 | /** @brief a frame containing contact points */ 71 | struct _RDPINPUT_TOUCH_FRAME 72 | { 73 | UINT32 contactCount; 74 | UINT64 frameOffset; 75 | RDPINPUT_CONTACT_DATA* contacts; 76 | }; 77 | typedef struct _RDPINPUT_TOUCH_FRAME RDPINPUT_TOUCH_FRAME; 78 | 79 | 80 | /** @brief a touch event with some frames*/ 81 | struct _RDPINPUT_TOUCH_EVENT 82 | { 83 | UINT32 encodeTime; 84 | UINT16 frameCount; 85 | RDPINPUT_TOUCH_FRAME* frames; 86 | }; 87 | typedef struct _RDPINPUT_TOUCH_EVENT RDPINPUT_TOUCH_EVENT; 88 | 89 | 90 | #endif /* __FREERDP_CHANNEL_RDPEI_H_ */ 91 | 92 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/channels/rdpsnd.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Audio Virtual Channel Types 4 | * 5 | * Copyright 2012 Vic Lee 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_CHANNEL_RDPSND_H 21 | #define FREERDP_CHANNEL_RDPSND_H 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | #endif /* FREERDP_CHANNEL_RDPSND_H */ 29 | 30 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/channels/tsmf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Video Redirection Virtual Channel - Callback interface 4 | * 5 | * (C) Copyright 2014 Thincast Technologies GmbH 6 | * (C) Copyright 2014 Armin Novak 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef FREERDP_CHANNEL_TSMF_H 22 | #define FREERDP_CHANNEL_TSMF_H 23 | 24 | #include 25 | 26 | #define TSMF_DVC_CHANNEL_NAME "TSMF" 27 | 28 | #endif /* FREERDP_CHANNEL_TSMF_H */ 29 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/channels/wtsvc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Server Virtual Channel Interface 4 | * 5 | * Copyright 2011-2012 Vic Lee 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | /** 21 | * The server-side virtual channel API follows the Microsoft Remote Desktop 22 | * Services API functions WTSVirtualChannel* defined in: 23 | * http://msdn.microsoft.com/en-us/library/windows/desktop/aa383464.aspx 24 | * 25 | * Difference between the MS API are documented in this header. All functions 26 | * are implemented in and integrated with libfreerdp-channels. 27 | * 28 | * Unlike MS API, all functions except WTSVirtualChannelOpenEx in this 29 | * implementation are thread-safe. 30 | */ 31 | 32 | #ifndef FREERDP_WTSVC_H 33 | #define FREERDP_WTSVC_H 34 | 35 | #include 36 | #include 37 | 38 | #include 39 | #include 40 | #include 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | /** 47 | * WTSVirtualChannelManager functions are FreeRDP extensions to the API. 48 | */ 49 | 50 | FREERDP_API void WTSVirtualChannelManagerGetFileDescriptor(HANDLE hServer, void** fds, int* fds_count); 51 | FREERDP_API BOOL WTSVirtualChannelManagerCheckFileDescriptor(HANDLE hServer); 52 | FREERDP_API HANDLE WTSVirtualChannelManagerGetEventHandle(HANDLE hServer); 53 | FREERDP_API BOOL WTSVirtualChannelManagerIsChannelJoined(HANDLE hServer, const char* name); 54 | 55 | /** 56 | * Extended FreeRDP WTS functions for channel handling 57 | */ 58 | FREERDP_API UINT16 WTSChannelGetId(freerdp_peer *client, const char *channel_name); 59 | FREERDP_API BOOL WTSIsChannelJoinedByName(freerdp_peer *client, const char *channel_name); 60 | FREERDP_API BOOL WTSIsChannelJoinedById(freerdp_peer *client, const UINT16 channel_id); 61 | FREERDP_API BOOL WTSChannelSetHandleByName(freerdp_peer *client, const char *channel_name, void *handle); 62 | FREERDP_API BOOL WTSChannelSetHandleById(freerdp_peer *client, const UINT16 channel_id, void *handle); 63 | FREERDP_API void *WTSChannelGetHandleByName(freerdp_peer *client, const char *channel_name); 64 | FREERDP_API void *WTSChannelGetHandleById(freerdp_peer *client, const UINT16 channel_id); 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif /* FREERDP_WTSVC_H */ 71 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/client/audin.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Audio Input Redirection Virtual Channel 4 | * 5 | * Copyright 2010-2011 Vic Lee 6 | * Copyright 2015 Thincast Technologies GmbH 7 | * Copyright 2015 DI (FH) Martin Haimberger 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #ifndef FREERDP_CHANNEL_CLIENT_AUDIN_H 23 | #define FREERDP_CHANNEL_CLIENT_AUDIN_H 24 | 25 | #include 26 | #include 27 | 28 | /** 29 | * Subsystem Interface 30 | */ 31 | 32 | typedef UINT (*AudinReceive) (const BYTE* data, int size, void* userData); 33 | 34 | typedef struct audin_format audinFormat; 35 | struct audin_format 36 | { 37 | UINT16 wFormatTag; 38 | UINT16 nChannels; 39 | UINT32 nSamplesPerSec; 40 | UINT16 nBlockAlign; 41 | UINT16 wBitsPerSample; 42 | UINT16 cbSize; 43 | BYTE* data; 44 | }; 45 | 46 | typedef struct _IAudinDevice IAudinDevice; 47 | struct _IAudinDevice 48 | { 49 | UINT (*Open) (IAudinDevice* devplugin, AudinReceive receive, void* userData); 50 | BOOL (*FormatSupported) (IAudinDevice* devplugin, audinFormat* format); 51 | UINT (*SetFormat) (IAudinDevice* devplugin, audinFormat* format, UINT32 FramesPerPacket); 52 | UINT (*Close) (IAudinDevice* devplugin); 53 | UINT (*Free) (IAudinDevice* devplugin); 54 | }; 55 | 56 | #define AUDIN_DEVICE_EXPORT_FUNC_NAME "freerdp_audin_client_subsystem_entry" 57 | 58 | typedef UINT (*PREGISTERAUDINDEVICE)(IWTSPlugin* plugin, IAudinDevice* device); 59 | 60 | struct _FREERDP_AUDIN_DEVICE_ENTRY_POINTS 61 | { 62 | IWTSPlugin* plugin; 63 | PREGISTERAUDINDEVICE pRegisterAudinDevice; 64 | ADDIN_ARGV* args; 65 | rdpContext* rdpcontext; 66 | }; 67 | typedef struct _FREERDP_AUDIN_DEVICE_ENTRY_POINTS FREERDP_AUDIN_DEVICE_ENTRY_POINTS; 68 | typedef FREERDP_AUDIN_DEVICE_ENTRY_POINTS* PFREERDP_AUDIN_DEVICE_ENTRY_POINTS; 69 | 70 | typedef UINT (*PFREERDP_AUDIN_DEVICE_ENTRY)(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints); 71 | 72 | #endif /* FREERDP_CHANNEL_CLIENT_AUDIN_H */ 73 | 74 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/client/channels.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Client Channels 4 | * 5 | * Copyright 2012 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_CHANNELS_CLIENT 21 | #define FREERDP_CHANNELS_CLIENT 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | FREERDP_API void* freerdp_channels_client_find_static_entry(const char* name, const char* identifier); 32 | FREERDP_API void* freerdp_channels_load_static_addin_entry(LPCSTR pszName, LPSTR pszSubsystem, LPSTR pszType, DWORD dwFlags); 33 | 34 | FREERDP_API FREERDP_ADDIN** freerdp_channels_list_addins(LPSTR lpName, LPSTR lpSubsystem, LPSTR lpType, DWORD dwFlags); 35 | FREERDP_API void freerdp_channels_addin_list_free(FREERDP_ADDIN** ppAddins); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif /* FREERDP_CHANNELS_CLIENT */ 42 | 43 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/client/cmdline.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * FreeRDP Client Command-Line Interface 4 | * 5 | * Copyright 2012 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_CLIENT_CMDLINE_H 21 | #define FREERDP_CLIENT_CMDLINE_H 22 | 23 | #include 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | FREERDP_API int freerdp_client_settings_parse_command_line_arguments( 31 | rdpSettings* settings, int argc, char** argv, BOOL allowUnknown); 32 | FREERDP_API int freerdp_client_settings_command_line_status_print(rdpSettings* settings, int status, int argc, char** argv); 33 | FREERDP_API BOOL freerdp_client_load_addins(rdpChannels* channels, rdpSettings* settings); 34 | 35 | FREERDP_API BOOL freerdp_client_print_version(void); 36 | FREERDP_API BOOL freerdp_client_print_buildconfig(void); 37 | FREERDP_API BOOL freerdp_client_print_command_line_help(int argc, char** argv); 38 | 39 | FREERDP_API BOOL freerdp_parse_username(char* username, char** user, char** domain); 40 | FREERDP_API BOOL freerdp_parse_hostname(char* hostname, char** host, int* port); 41 | FREERDP_API BOOL freerdp_set_connection_type(rdpSettings* settings, int type); 42 | 43 | FREERDP_API BOOL freerdp_client_add_device_channel(rdpSettings* settings, int count, char** params); 44 | FREERDP_API BOOL freerdp_client_add_static_channel(rdpSettings* settings, int count, char** params); 45 | FREERDP_API BOOL freerdp_client_add_dynamic_channel(rdpSettings* settings, int count, char** params); 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif /* FREERDP_CLIENT_CMDLINE_H */ 52 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/client/disp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Display Update Virtual Channel Extension 4 | * 5 | * Copyright 2013 Marc-Andre Moreau 6 | * Copyright 2015 Thincast Technologies GmbH 7 | * Copyright 2015 DI (FH) Martin Haimberger 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #ifndef FREERDP_CHANNEL_CLIENT_DISP_H 23 | #define FREERDP_CHANNEL_CLIENT_DISP_H 24 | 25 | #define ORIENTATION_LANDSCAPE 0 26 | #define ORIENTATION_PORTRAIT 90 27 | #define ORIENTATION_LANDSCAPE_FLIPPED 180 28 | #define ORIENTATION_PORTRAIT_FLIPPED 270 29 | 30 | #define DISPLAY_CONTROL_MONITOR_PRIMARY 0x00000001 31 | 32 | struct _DISPLAY_CONTROL_MONITOR_LAYOUT 33 | { 34 | UINT32 Flags; 35 | INT32 Left; 36 | INT32 Top; 37 | UINT32 Width; 38 | UINT32 Height; 39 | UINT32 PhysicalWidth; 40 | UINT32 PhysicalHeight; 41 | UINT32 Orientation; 42 | UINT32 DesktopScaleFactor; 43 | UINT32 DeviceScaleFactor; 44 | }; 45 | typedef struct _DISPLAY_CONTROL_MONITOR_LAYOUT DISPLAY_CONTROL_MONITOR_LAYOUT; 46 | 47 | /** 48 | * Client Interface 49 | */ 50 | 51 | #define DISP_DVC_CHANNEL_NAME "Microsoft::Windows::RDS::DisplayControl" 52 | 53 | typedef struct _disp_client_context DispClientContext; 54 | 55 | typedef UINT (*pcDispSendMonitorLayout)(DispClientContext* context, UINT32 NumMonitors, DISPLAY_CONTROL_MONITOR_LAYOUT* Monitors); 56 | 57 | struct _disp_client_context 58 | { 59 | void* handle; 60 | void* custom; 61 | 62 | pcDispSendMonitorLayout SendMonitorLayout; 63 | }; 64 | 65 | #endif /* FREERDP_CHANNEL_CLIENT_DISP_H */ 66 | 67 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/client/drdynvc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Dynamic Virtual Channel Extension 4 | * 5 | * Copyright 2013 Marc-Andre Moreau 6 | * Copyright 2015 Thincast Technologies GmbH 7 | * Copyright 2015 DI (FH) Martin Haimberger 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #ifndef FREERDP_CHANNEL_CLIENT_DRDYNVC_H 23 | #define FREERDP_CHANNEL_CLIENT_DRDYNVC_H 24 | 25 | /** 26 | * Client Interface 27 | */ 28 | 29 | typedef struct _drdynvc_client_context DrdynvcClientContext; 30 | 31 | typedef int (*pcDrdynvcGetVersion)(DrdynvcClientContext* context); 32 | typedef UINT (*pcDrdynvcOnChannelConnected)(DrdynvcClientContext* context, const char* name, void* pInterface); 33 | typedef UINT (*pcDrdynvcOnChannelDisconnected)(DrdynvcClientContext* context, const char* name, void* pInterface); 34 | 35 | struct _drdynvc_client_context 36 | { 37 | void* handle; 38 | void* custom; 39 | 40 | pcDrdynvcGetVersion GetVersion; 41 | pcDrdynvcOnChannelConnected OnChannelConnected; 42 | pcDrdynvcOnChannelDisconnected OnChannelDisconnected; 43 | }; 44 | 45 | #endif /* FREERDP_CHANNEL_CLIENT_DRDYNVC_H */ 46 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/client/encomsp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Multiparty Virtual Channel 4 | * 5 | * Copyright 2014 Marc-Andre Moreau 6 | * Copyright 2015 Thincast Technologies GmbH 7 | * Copyright 2015 DI (FH) Martin Haimberger 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #ifndef FREERDP_CHANNEL_CLIENT_ENCOMSP_H 23 | #define FREERDP_CHANNEL_CLIENT_ENCOMSP_H 24 | 25 | #include 26 | 27 | /** 28 | * Client Interface 29 | */ 30 | 31 | typedef struct _encomsp_client_context EncomspClientContext; 32 | 33 | typedef UINT (*pcEncomspFilterUpdated)(EncomspClientContext* context, ENCOMSP_FILTER_UPDATED_PDU* filterUpdated); 34 | typedef UINT (*pcEncomspApplicationCreated)(EncomspClientContext* context, ENCOMSP_APPLICATION_CREATED_PDU* applicationCreated); 35 | typedef UINT (*pcEncomspApplicationRemoved)(EncomspClientContext* context, ENCOMSP_APPLICATION_REMOVED_PDU* applicationRemoved); 36 | typedef UINT (*pcEncomspWindowCreated)(EncomspClientContext* context, ENCOMSP_WINDOW_CREATED_PDU* windowCreated); 37 | typedef UINT (*pcEncomspWindowRemoved)(EncomspClientContext* context, ENCOMSP_WINDOW_REMOVED_PDU* windowRemoved); 38 | typedef UINT (*pcEncomspShowWindow)(EncomspClientContext* context, ENCOMSP_SHOW_WINDOW_PDU* showWindow); 39 | typedef UINT (*pcEncomspParticipantCreated)(EncomspClientContext* context, ENCOMSP_PARTICIPANT_CREATED_PDU* participantCreated); 40 | typedef UINT (*pcEncomspParticipantRemoved)(EncomspClientContext* context, ENCOMSP_PARTICIPANT_REMOVED_PDU* participantRemoved); 41 | typedef UINT (*pcEncomspChangeParticipantControlLevel)(EncomspClientContext* context, ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU* changeParticipantControlLevel); 42 | typedef UINT (*pcEncomspGraphicsStreamPaused)(EncomspClientContext* context, ENCOMSP_GRAPHICS_STREAM_PAUSED_PDU* graphicsStreamPaused); 43 | typedef UINT (*pcEncomspGraphicsStreamResumed)(EncomspClientContext* context, ENCOMSP_GRAPHICS_STREAM_RESUMED_PDU* graphicsStreamResumed); 44 | 45 | struct _encomsp_client_context 46 | { 47 | void* handle; 48 | void* custom; 49 | 50 | pcEncomspFilterUpdated FilterUpdated; 51 | pcEncomspApplicationCreated ApplicationCreated; 52 | pcEncomspApplicationRemoved ApplicationRemoved; 53 | pcEncomspWindowCreated WindowCreated; 54 | pcEncomspWindowRemoved WindowRemoved; 55 | pcEncomspShowWindow ShowWindow; 56 | pcEncomspParticipantCreated ParticipantCreated; 57 | pcEncomspParticipantRemoved ParticipantRemoved; 58 | pcEncomspChangeParticipantControlLevel ChangeParticipantControlLevel; 59 | pcEncomspGraphicsStreamPaused GraphicsStreamPaused; 60 | pcEncomspGraphicsStreamResumed GraphicsStreamResumed; 61 | }; 62 | 63 | #endif /* FREERDP_CHANNEL_CLIENT_ENCOMSP_H */ 64 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/client/rdpei.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Dynamic Virtual Channel Extension 4 | * 5 | * Copyright 2013 Marc-Andre Moreau 6 | * Copyright 2015 Thincast Technologies GmbH 7 | * Copyright 2015 DI (FH) Martin Haimberger 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #ifndef FREERDP_CHANNEL_CLIENT_RDPEI_H 23 | #define FREERDP_CHANNEL_CLIENT_RDPEI_H 24 | 25 | #include 26 | 27 | /** 28 | * Client Interface 29 | */ 30 | 31 | typedef struct _rdpei_client_context RdpeiClientContext; 32 | 33 | typedef int (*pcRdpeiGetVersion)(RdpeiClientContext* context); 34 | typedef UINT (*pcRdpeiAddContact)(RdpeiClientContext* context, RDPINPUT_CONTACT_DATA* contact); 35 | 36 | typedef UINT (*pcRdpeiTouchBegin)(RdpeiClientContext* context, int externalId, int x, int y, int* contactId); 37 | typedef UINT (*pcRdpeiTouchUpdate)(RdpeiClientContext* context, int externalId, int x, int y, int* contactId); 38 | typedef UINT (*pcRdpeiTouchEnd)(RdpeiClientContext* context, int externalId, int x, int y, int* contactId); 39 | 40 | typedef UINT (*pcRdpeiSuspendTouch)(RdpeiClientContext* context); 41 | typedef UINT (*pcRdpeiResumeTouch)(RdpeiClientContext* context); 42 | 43 | struct _rdpei_client_context 44 | { 45 | void* handle; 46 | void* custom; 47 | 48 | pcRdpeiGetVersion GetVersion; 49 | 50 | pcRdpeiAddContact AddContact; 51 | 52 | pcRdpeiTouchBegin TouchBegin; 53 | pcRdpeiTouchUpdate TouchUpdate; 54 | pcRdpeiTouchEnd TouchEnd; 55 | 56 | pcRdpeiSuspendTouch SuspendTouch; 57 | pcRdpeiResumeTouch ResumeTouch; 58 | }; 59 | 60 | #endif /* FREERDP_CHANNEL_CLIENT_RDPEI_H */ 61 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/client/rdpsnd.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Audio Output Virtual Channel 4 | * 5 | * Copyright 2010-2011 Vic Lee 6 | * Copyright 2012-2013 Marc-Andre Moreau 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef FREERDP_CHANNEL_CLIENT_RDPSND_H 22 | #define FREERDP_CHANNEL_CLIENT_RDPSND_H 23 | 24 | #include 25 | 26 | /** 27 | * Subsystem Interface 28 | */ 29 | 30 | struct _RDPSND_WAVE 31 | { 32 | BYTE* data; 33 | int length; 34 | 35 | BYTE cBlockNo; 36 | UINT16 wFormatNo; 37 | UINT16 wTimeStampA; 38 | UINT16 wTimeStampB; 39 | 40 | UINT16 wAudioLength; 41 | 42 | UINT32 wLocalTimeA; 43 | UINT32 wLocalTimeB; 44 | 45 | BOOL AutoConfirm; 46 | }; 47 | typedef struct _RDPSND_WAVE RDPSND_WAVE; 48 | 49 | typedef struct rdpsnd_plugin rdpsndPlugin; 50 | 51 | typedef struct rdpsnd_device_plugin rdpsndDevicePlugin; 52 | 53 | typedef BOOL (*pcFormatSupported) (rdpsndDevicePlugin* device, AUDIO_FORMAT* format); 54 | typedef BOOL (*pcOpen) (rdpsndDevicePlugin* device, AUDIO_FORMAT* format, int latency); 55 | typedef BOOL (*pcSetFormat) (rdpsndDevicePlugin* device, AUDIO_FORMAT* format, int latency); 56 | typedef UINT32 (*pcGetVolume) (rdpsndDevicePlugin* device); 57 | typedef BOOL (*pcSetVolume) (rdpsndDevicePlugin* device, UINT32 value); 58 | typedef void (*pcPlay) (rdpsndDevicePlugin* device, BYTE* data, int size); 59 | typedef void (*pcStart) (rdpsndDevicePlugin* device); 60 | typedef void (*pcClose) (rdpsndDevicePlugin* device); 61 | typedef void (*pcFree) (rdpsndDevicePlugin* device); 62 | 63 | typedef BOOL (*pcWaveDecode) (rdpsndDevicePlugin* device, RDPSND_WAVE* wave); 64 | typedef void (*pcWavePlay) (rdpsndDevicePlugin* device, RDPSND_WAVE* wave); 65 | typedef UINT (*pcWaveConfirm) (rdpsndDevicePlugin* device, RDPSND_WAVE* wave); 66 | 67 | struct rdpsnd_device_plugin 68 | { 69 | rdpsndPlugin* rdpsnd; 70 | 71 | pcFormatSupported FormatSupported; 72 | pcOpen Open; 73 | pcSetFormat SetFormat; 74 | pcGetVolume GetVolume; 75 | pcSetVolume SetVolume; 76 | pcPlay Play; 77 | pcStart Start; 78 | pcClose Close; 79 | pcFree Free; 80 | 81 | pcWaveDecode WaveDecode; 82 | pcWavePlay WavePlay; 83 | pcWaveConfirm WaveConfirm; 84 | 85 | BOOL DisableConfirmThread; 86 | }; 87 | 88 | #define RDPSND_DEVICE_EXPORT_FUNC_NAME "freerdp_rdpsnd_client_subsystem_entry" 89 | 90 | typedef void (*PREGISTERRDPSNDDEVICE)(rdpsndPlugin* rdpsnd, rdpsndDevicePlugin* device); 91 | 92 | struct _FREERDP_RDPSND_DEVICE_ENTRY_POINTS 93 | { 94 | rdpsndPlugin* rdpsnd; 95 | PREGISTERRDPSNDDEVICE pRegisterRdpsndDevice; 96 | ADDIN_ARGV* args; 97 | }; 98 | typedef struct _FREERDP_RDPSND_DEVICE_ENTRY_POINTS FREERDP_RDPSND_DEVICE_ENTRY_POINTS; 99 | typedef FREERDP_RDPSND_DEVICE_ENTRY_POINTS* PFREERDP_RDPSND_DEVICE_ENTRY_POINTS; 100 | 101 | typedef UINT (*PFREERDP_RDPSND_DEVICE_ENTRY)(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints); 102 | 103 | #endif /* FREERDP_CHANNEL_CLIENT_RDPSND_H */ 104 | 105 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/client/remdesk.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Remote Assistance Virtual Channel 4 | * 5 | * Copyright 2014 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_CHANNEL_CLIENT_REMDESK_H 21 | #define FREERDP_CHANNEL_CLIENT_REMDESK_H 22 | 23 | #include 24 | 25 | /** 26 | * Client Interface 27 | */ 28 | 29 | typedef struct _remdesk_client_context RemdeskClientContext; 30 | 31 | struct _remdesk_client_context 32 | { 33 | void* handle; 34 | void* custom; 35 | }; 36 | 37 | #endif /* FREERDP_CHANNEL_CLIENT_REMDESK_H */ 38 | 39 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/client/tsmf.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Multimedia Redirection Virtual Channel Types 4 | * 5 | * Copyright 2011 Vic Lee 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_CHANNEL_CLIENT_TSMF_H 21 | #define FREERDP_CHANNEL_CLIENT_TSMF_H 22 | 23 | #include 24 | 25 | #include 26 | 27 | /* RDP_VIDEO_FRAME_EVENT.frame_pixfmt */ 28 | /* http://www.fourcc.org/yuv.php */ 29 | #define RDP_PIXFMT_I420 0x30323449 30 | #define RDP_PIXFMT_YV12 0x32315659 31 | 32 | struct _TSMF_VIDEO_FRAME_EVENT 33 | { 34 | BYTE* frameData; 35 | UINT32 frameSize; 36 | UINT32 framePixFmt; 37 | INT16 frameWidth; 38 | INT16 frameHeight; 39 | INT16 x; 40 | INT16 y; 41 | INT16 width; 42 | INT16 height; 43 | UINT16 numVisibleRects; 44 | RECTANGLE_16* visibleRects; 45 | }; 46 | typedef struct _TSMF_VIDEO_FRAME_EVENT TSMF_VIDEO_FRAME_EVENT; 47 | 48 | /** 49 | * Client Interface 50 | */ 51 | 52 | typedef struct _tsmf_client_context TsmfClientContext; 53 | 54 | typedef int (*pcTsmfFrameEvent)(TsmfClientContext* context, TSMF_VIDEO_FRAME_EVENT* event); 55 | 56 | struct _tsmf_client_context 57 | { 58 | void* handle; 59 | void* custom; 60 | 61 | pcTsmfFrameEvent FrameEvent; 62 | }; 63 | 64 | #endif /* FREERDP_CHANNEL_CLIENT_TSMF_H */ 65 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/codec/bitmap.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Compressed Bitmap 4 | * 5 | * Copyright 2011 Jay Sorg 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_CODEC_BITMAP_H 21 | #define FREERDP_CODEC_BITMAP_H 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | #include 29 | #include 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | FREERDP_API int freerdp_bitmap_compress(char* in_data, int width, int height, 36 | wStream* s, int bpp, int byte_limit, int start_line, wStream* temp_s, int e); 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif /* FREERDP_CODEC_BITMAP_H */ 43 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/codec/bulk.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Bulk Data Compression 4 | * 5 | * Copyright 2014 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_CODEC_BULK_H 21 | #define FREERDP_CODEC_BULK_H 22 | 23 | #include 24 | #include 25 | 26 | /* Level-2 Compression Flags */ 27 | 28 | #define PACKET_COMPRESSED 0x20 29 | #define PACKET_AT_FRONT 0x40 30 | #define PACKET_FLUSHED 0x80 31 | 32 | /* Level-1 Compression Flags */ 33 | 34 | #define L1_PACKET_AT_FRONT 0x04 35 | #define L1_NO_COMPRESSION 0x02 36 | #define L1_COMPRESSED 0x01 37 | #define L1_INNER_COMPRESSION 0x10 38 | 39 | #endif /* FREERDP_CODEC_BULK_H */ 40 | 41 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/codec/clear.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * ClearCodec Bitmap Compression 4 | * 5 | * Copyright 2014 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_CODEC_CLEAR_H 21 | #define FREERDP_CODEC_CLEAR_H 22 | 23 | typedef struct _CLEAR_CONTEXT CLEAR_CONTEXT; 24 | 25 | #include 26 | #include 27 | 28 | #include 29 | #include 30 | 31 | #define CLEARCODEC_FLAG_GLYPH_INDEX 0x01 32 | #define CLEARCODEC_FLAG_GLYPH_HIT 0x02 33 | #define CLEARCODEC_FLAG_CACHE_RESET 0x04 34 | 35 | struct _CLEAR_GLYPH_ENTRY 36 | { 37 | UINT32 size; 38 | UINT32 count; 39 | UINT32* pixels; 40 | }; 41 | typedef struct _CLEAR_GLYPH_ENTRY CLEAR_GLYPH_ENTRY; 42 | 43 | struct _CLEAR_VBAR_ENTRY 44 | { 45 | UINT32 size; 46 | UINT32 count; 47 | UINT32* pixels; 48 | }; 49 | typedef struct _CLEAR_VBAR_ENTRY CLEAR_VBAR_ENTRY; 50 | 51 | struct _CLEAR_CONTEXT 52 | { 53 | BOOL Compressor; 54 | NSC_CONTEXT* nsc; 55 | UINT32 seqNumber; 56 | BYTE* TempBuffer; 57 | UINT32 TempSize; 58 | CLEAR_GLYPH_ENTRY GlyphCache[4000]; 59 | UINT32 VBarStorageCursor; 60 | CLEAR_VBAR_ENTRY VBarStorage[32768]; 61 | UINT32 ShortVBarStorageCursor; 62 | CLEAR_VBAR_ENTRY ShortVBarStorage[16384]; 63 | }; 64 | 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | FREERDP_API int clear_compress(CLEAR_CONTEXT* clear, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize); 70 | 71 | FREERDP_API int clear_decompress(CLEAR_CONTEXT* clear, BYTE* pSrcData, UINT32 SrcSize, 72 | BYTE** ppDstData, DWORD DstFormat, int nDstStep, int nXDst, int nYDst, int nWidth, int nHeight); 73 | 74 | FREERDP_API int clear_context_reset(CLEAR_CONTEXT* clear); 75 | 76 | FREERDP_API CLEAR_CONTEXT* clear_context_new(BOOL Compressor); 77 | FREERDP_API void clear_context_free(CLEAR_CONTEXT* clear); 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | 83 | #endif /* FREERDP_CODEC_CLEAR_H */ 84 | 85 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/codec/dsp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Digital Sound Processing 4 | * 5 | * Copyright 2010-2011 Vic Lee 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_CODEC_DSP_H 21 | #define FREERDP_CODEC_DSP_H 22 | 23 | #include 24 | 25 | union _ADPCM 26 | { 27 | struct 28 | { 29 | INT16 last_sample[2]; 30 | INT16 last_step[2]; 31 | } ima; 32 | struct 33 | { 34 | BYTE predictor[2]; 35 | INT32 delta[2]; 36 | INT32 sample1[2]; 37 | INT32 sample2[2]; 38 | } ms; 39 | }; 40 | typedef union _ADPCM ADPCM; 41 | 42 | typedef struct _FREERDP_DSP_CONTEXT FREERDP_DSP_CONTEXT; 43 | 44 | struct _FREERDP_DSP_CONTEXT 45 | { 46 | BYTE* resampled_buffer; 47 | UINT32 resampled_size; 48 | UINT32 resampled_frames; 49 | UINT32 resampled_maxlength; 50 | 51 | BYTE* adpcm_buffer; 52 | UINT32 adpcm_size; 53 | UINT32 adpcm_maxlength; 54 | 55 | ADPCM adpcm; 56 | 57 | BOOL (*resample)(FREERDP_DSP_CONTEXT* context, 58 | const BYTE* src, int bytes_per_sample, 59 | UINT32 schan, UINT32 srate, int sframes, 60 | UINT32 rchan, UINT32 rrate); 61 | 62 | BOOL (*decode_ima_adpcm)(FREERDP_DSP_CONTEXT* context, 63 | const BYTE* src, int size, int channels, int block_size); 64 | BOOL (*encode_ima_adpcm)(FREERDP_DSP_CONTEXT* context, 65 | const BYTE* src, int size, int channels, int block_size); 66 | 67 | BOOL (*decode_ms_adpcm)(FREERDP_DSP_CONTEXT* context, 68 | const BYTE* src, int size, int channels, int block_size); 69 | BOOL (*encode_ms_adpcm)(FREERDP_DSP_CONTEXT* context, 70 | const BYTE* src, int size, int channels, int block_size); 71 | }; 72 | 73 | #ifdef __cplusplus 74 | extern "C" { 75 | #endif 76 | 77 | FREERDP_API FREERDP_DSP_CONTEXT* freerdp_dsp_context_new(void); 78 | FREERDP_API void freerdp_dsp_context_free(FREERDP_DSP_CONTEXT* context); 79 | #define freerdp_dsp_context_reset_adpcm(_c) memset(&_c->adpcm, 0, sizeof(ADPCM)) 80 | 81 | #ifdef __cplusplus 82 | } 83 | #endif 84 | 85 | #endif /* FREERDP_CODEC_DSP_H */ 86 | 87 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/codec/h264.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * H.264 Bitmap Compression 4 | * 5 | * Copyright 2014 Mike McDonald 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_CODEC_H264_H 21 | #define FREERDP_CODEC_H264_H 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | typedef struct _H264_CONTEXT H264_CONTEXT; 28 | 29 | typedef BOOL (*pfnH264SubsystemInit)(H264_CONTEXT* h264); 30 | typedef void (*pfnH264SubsystemUninit)(H264_CONTEXT* h264); 31 | 32 | typedef int (*pfnH264SubsystemDecompress)(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize); 33 | typedef int (*pfnH264SubsystemCompress)(H264_CONTEXT* h264, BYTE** ppDstData, UINT32* pDstSize); 34 | 35 | struct _H264_CONTEXT_SUBSYSTEM 36 | { 37 | const char* name; 38 | pfnH264SubsystemInit Init; 39 | pfnH264SubsystemUninit Uninit; 40 | pfnH264SubsystemDecompress Decompress; 41 | pfnH264SubsystemCompress Compress; 42 | }; 43 | typedef struct _H264_CONTEXT_SUBSYSTEM H264_CONTEXT_SUBSYSTEM; 44 | 45 | enum _H264_RATECONTROL_MODE 46 | { 47 | H264_RATECONTROL_VBR = 0, 48 | H264_RATECONTROL_CQP 49 | }; 50 | typedef enum _H264_RATECONTROL_MODE H264_RATECONTROL_MODE; 51 | 52 | struct _H264_CONTEXT 53 | { 54 | BOOL Compressor; 55 | 56 | UINT32 width; 57 | UINT32 height; 58 | 59 | H264_RATECONTROL_MODE RateControlMode; 60 | UINT32 BitRate; 61 | FLOAT FrameRate; 62 | UINT32 QP; 63 | UINT32 NumberOfThreads; 64 | 65 | int iStride[3]; 66 | BYTE* pYUVData[3]; 67 | 68 | void* pSystemData; 69 | H264_CONTEXT_SUBSYSTEM* subsystem; 70 | }; 71 | 72 | #ifdef __cplusplus 73 | extern "C" { 74 | #endif 75 | 76 | FREERDP_API int h264_compress(H264_CONTEXT* h264, BYTE* pSrcData, DWORD SrcFormat, 77 | int nSrcStep, int nSrcWidth, int nSrcHeight, BYTE** ppDstData, UINT32* pDstSize); 78 | 79 | FREERDP_API int h264_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize, 80 | BYTE** ppDstData, DWORD DstFormat, int nDstStep, int nDstWidth, int nDstHeight, 81 | RDPGFX_RECT16* regionRects, int numRegionRect); 82 | 83 | FREERDP_API int h264_context_reset(H264_CONTEXT* h264); 84 | 85 | FREERDP_API H264_CONTEXT* h264_context_new(BOOL Compressor); 86 | FREERDP_API void h264_context_free(H264_CONTEXT* h264); 87 | 88 | #ifdef __cplusplus 89 | } 90 | #endif 91 | 92 | #endif /* FREERDP_CODEC_H264_H */ 93 | 94 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/codec/interleaved.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Interleaved RLE Bitmap Codec 4 | * 5 | * Copyright 2014 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_CODEC_INTERLEAVED_H 21 | #define FREERDP_CODEC_INTERLEAVED_H 22 | 23 | typedef struct _BITMAP_INTERLEAVED_CONTEXT BITMAP_INTERLEAVED_CONTEXT; 24 | 25 | #include 26 | #include 27 | 28 | #include 29 | #include 30 | 31 | struct _BITMAP_INTERLEAVED_CONTEXT 32 | { 33 | BOOL Compressor; 34 | 35 | UINT32 TempSize; 36 | BYTE* TempBuffer; 37 | 38 | wStream* bts; 39 | }; 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | FREERDP_API int interleaved_decompress(BITMAP_INTERLEAVED_CONTEXT* interleaved, BYTE* pSrcData, UINT32 SrcSize, int bpp, 46 | BYTE** ppDstData, DWORD DstFormat, int nDstStep, int nXDst, int nYDst, int nWidth, int nHeight, BYTE* palette); 47 | 48 | FREERDP_API int interleaved_compress(BITMAP_INTERLEAVED_CONTEXT* interleaved, BYTE* pDstData, UINT32* pDstSize, 49 | int nWidth, int nHeight, BYTE* pSrcData, DWORD SrcFormat, int nSrcStep, int nXSrc, int nYSrc, BYTE* palette, int bpp); 50 | 51 | FREERDP_API int bitmap_interleaved_context_reset(BITMAP_INTERLEAVED_CONTEXT* interleaved); 52 | 53 | FREERDP_API BITMAP_INTERLEAVED_CONTEXT* bitmap_interleaved_context_new(BOOL Compressor); 54 | FREERDP_API void bitmap_interleaved_context_free(BITMAP_INTERLEAVED_CONTEXT* interleaved); 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif /* FREERDP_CODEC_INTERLEAVED_H */ 61 | 62 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/codec/jpeg.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Compressed Bitmap 4 | * 5 | * Copyright 2012 Jay Sorg 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_CODEC_JPEG_H 21 | #define FREERDP_CODEC_JPEG_H 22 | 23 | #include 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | FREERDP_API BOOL jpeg_decompress(BYTE* input, BYTE* output, int width, int height, int size, int bpp); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif /* FREERDP_CODEC_JPEG_H */ 37 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/codec/mppc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * MPPC Bulk Data Compression 4 | * 5 | * Copyright 2014 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_MPPC_H 21 | #define FREERDP_MPPC_H 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | #include 29 | 30 | struct _MPPC_CONTEXT 31 | { 32 | wBitStream* bs; 33 | BOOL Compressor; 34 | BYTE* HistoryPtr; 35 | UINT32 HistoryOffset; 36 | UINT32 HistoryBufferSize; 37 | BYTE HistoryBuffer[65536]; 38 | UINT16 MatchBuffer[32768]; 39 | UINT32 CompressionLevel; 40 | }; 41 | typedef struct _MPPC_CONTEXT MPPC_CONTEXT; 42 | 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | FREERDP_API int mppc_compress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize, UINT32* pFlags); 48 | FREERDP_API int mppc_decompress(MPPC_CONTEXT* mppc, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize, UINT32 flags); 49 | 50 | FREERDP_API void mppc_set_compression_level(MPPC_CONTEXT* mppc, DWORD CompressionLevel); 51 | 52 | FREERDP_API void mppc_context_reset(MPPC_CONTEXT* mppc, BOOL flush); 53 | 54 | FREERDP_API MPPC_CONTEXT* mppc_context_new(DWORD CompressionLevel, BOOL Compressor); 55 | FREERDP_API void mppc_context_free(MPPC_CONTEXT* mppc); 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif /* FREERDP_MPPC_H */ 62 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/codec/ncrush.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * NCrush (RDP6) Bulk Data Compression 4 | * 5 | * Copyright 2014 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_CODEC_NCRUSH_H 21 | #define FREERDP_CODEC_NCRUSH_H 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | #include 29 | 30 | struct _NCRUSH_CONTEXT 31 | { 32 | BOOL Compressor; 33 | BYTE* HistoryPtr; 34 | UINT32 HistoryOffset; 35 | UINT32 HistoryEndOffset; 36 | UINT32 HistoryBufferSize; 37 | BYTE HistoryBuffer[65536]; 38 | UINT32 HistoryBufferFence; 39 | UINT32 OffsetCache[4]; 40 | UINT16 HashTable[65536]; 41 | UINT16 MatchTable[65536]; 42 | BYTE HuffTableCopyOffset[1024]; 43 | BYTE HuffTableLOM[4096]; 44 | }; 45 | typedef struct _NCRUSH_CONTEXT NCRUSH_CONTEXT; 46 | 47 | #ifdef __cplusplus 48 | extern "C" { 49 | #endif 50 | 51 | FREERDP_API int ncrush_compress(NCRUSH_CONTEXT* ncrush, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize, UINT32* pFlags); 52 | FREERDP_API int ncrush_decompress(NCRUSH_CONTEXT* ncrush, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize, UINT32 flags); 53 | 54 | FREERDP_API void ncrush_context_reset(NCRUSH_CONTEXT* ncrush, BOOL flush); 55 | 56 | FREERDP_API NCRUSH_CONTEXT* ncrush_context_new(BOOL Compressor); 57 | FREERDP_API void ncrush_context_free(NCRUSH_CONTEXT* ncrush); 58 | 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | 63 | #endif /* FREERDP_CODEC_NCRUSH_H */ 64 | 65 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/codec/nsc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * NSCodec Codec 4 | * 5 | * Copyright 2011 Samsung, Author Jiten Pathy 6 | * Copyright 2012 Vic Lee 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef FREERDP_CODEC_NSCODEC_H 22 | #define FREERDP_CODEC_NSCODEC_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #include 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | struct _NSC_MESSAGE 35 | { 36 | int x; 37 | int y; 38 | UINT32 width; 39 | UINT32 height; 40 | BYTE* data; 41 | int scanline; 42 | BYTE* PlaneBuffer; 43 | UINT32 MaxPlaneSize; 44 | BYTE* PlaneBuffers[5]; 45 | UINT32 OrgByteCount[4]; 46 | 47 | UINT32 LumaPlaneByteCount; 48 | UINT32 OrangeChromaPlaneByteCount; 49 | UINT32 GreenChromaPlaneByteCount; 50 | UINT32 AlphaPlaneByteCount; 51 | UINT32 ColorLossLevel; 52 | UINT32 ChromaSubsamplingLevel; 53 | }; 54 | typedef struct _NSC_MESSAGE NSC_MESSAGE; 55 | 56 | typedef struct _NSC_CONTEXT_PRIV NSC_CONTEXT_PRIV; 57 | 58 | typedef struct _NSC_CONTEXT NSC_CONTEXT; 59 | 60 | struct _NSC_CONTEXT 61 | { 62 | UINT32 OrgByteCount[4]; 63 | UINT16 bpp; 64 | UINT16 width; 65 | UINT16 height; 66 | BYTE* BitmapData; 67 | UINT32 BitmapDataLength; 68 | RDP_PIXEL_FORMAT pixel_format; 69 | 70 | BYTE* Planes; 71 | UINT32 PlaneByteCount[4]; 72 | UINT32 ColorLossLevel; 73 | UINT32 ChromaSubsamplingLevel; 74 | BOOL DynamicColorFidelity; 75 | 76 | /* color palette allocated by the application */ 77 | const BYTE* palette; 78 | 79 | void (*decode)(NSC_CONTEXT* context); 80 | void (*encode)(NSC_CONTEXT* context, BYTE* BitmapData, int rowstride); 81 | 82 | NSC_CONTEXT_PRIV* priv; 83 | }; 84 | 85 | FREERDP_API void nsc_context_set_pixel_format(NSC_CONTEXT* context, RDP_PIXEL_FORMAT pixel_format); 86 | FREERDP_API int nsc_process_message(NSC_CONTEXT* context, UINT16 bpp, 87 | UINT16 width, UINT16 height, BYTE* data, UINT32 length); 88 | FREERDP_API void nsc_compose_message(NSC_CONTEXT* context, wStream* s, 89 | BYTE* bmpdata, int width, int height, int rowstride); 90 | 91 | FREERDP_API NSC_MESSAGE* nsc_encode_messages(NSC_CONTEXT* context, BYTE* data, int x, int y, 92 | int width, int height, int scanline, int* numMessages, int maxDataSize); 93 | FREERDP_API int nsc_write_message(NSC_CONTEXT* context, wStream* s, NSC_MESSAGE* message); 94 | FREERDP_API int nsc_message_free(NSC_CONTEXT* context, NSC_MESSAGE* message); 95 | 96 | FREERDP_API int nsc_context_reset(NSC_CONTEXT* context); 97 | 98 | FREERDP_API NSC_CONTEXT* nsc_context_new(void); 99 | FREERDP_API void nsc_context_free(NSC_CONTEXT* context); 100 | 101 | #ifdef __cplusplus 102 | } 103 | #endif 104 | 105 | #endif /* FREERDP_CODEC_NSCODEC_H */ 106 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/codec/xcrush.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * XCrush (RDP6.1) Bulk Data Compression 4 | * 5 | * Copyright 2014 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_CODEC_XCRUSH_H 21 | #define FREERDP_CODEC_XCRUSH_H 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | #pragma pack(push, 1) 29 | 30 | struct _XCRUSH_MATCH_INFO 31 | { 32 | UINT32 MatchOffset; 33 | UINT32 ChunkOffset; 34 | UINT32 MatchLength; 35 | }; 36 | typedef struct _XCRUSH_MATCH_INFO XCRUSH_MATCH_INFO; 37 | 38 | struct _XCRUSH_CHUNK 39 | { 40 | UINT32 offset; 41 | UINT32 next; 42 | }; 43 | typedef struct _XCRUSH_CHUNK XCRUSH_CHUNK; 44 | 45 | struct _XCRUSH_SIGNATURE 46 | { 47 | UINT16 seed; 48 | UINT16 size; 49 | }; 50 | typedef struct _XCRUSH_SIGNATURE XCRUSH_SIGNATURE; 51 | 52 | struct _RDP61_MATCH_DETAILS 53 | { 54 | UINT16 MatchLength; 55 | UINT16 MatchOutputOffset; 56 | UINT32 MatchHistoryOffset; 57 | }; 58 | typedef struct _RDP61_MATCH_DETAILS RDP61_MATCH_DETAILS; 59 | 60 | struct _RDP61_COMPRESSED_DATA 61 | { 62 | BYTE Level1ComprFlags; 63 | BYTE Level2ComprFlags; 64 | UINT16 MatchCount; 65 | RDP61_MATCH_DETAILS* MatchDetails; 66 | BYTE* Literals; 67 | }; 68 | typedef struct _RDP61_COMPRESSED_DATA RDP61_COMPRESSED_DATA; 69 | 70 | #pragma pack(pop) 71 | 72 | struct _XCRUSH_CONTEXT 73 | { 74 | BOOL Compressor; 75 | MPPC_CONTEXT* mppc; 76 | BYTE* HistoryPtr; 77 | UINT32 HistoryOffset; 78 | UINT32 HistoryBufferSize; 79 | BYTE HistoryBuffer[2000000]; 80 | BYTE BlockBuffer[16384]; 81 | UINT32 CompressionFlags; 82 | 83 | UINT32 SignatureIndex; 84 | UINT32 SignatureCount; 85 | XCRUSH_SIGNATURE Signatures[1000]; 86 | 87 | UINT32 ChunkHead; 88 | UINT32 ChunkTail; 89 | XCRUSH_CHUNK Chunks[65534]; 90 | UINT16 NextChunks[65536]; 91 | 92 | UINT32 OriginalMatchCount; 93 | UINT32 OptimizedMatchCount; 94 | XCRUSH_MATCH_INFO OriginalMatches[1000]; 95 | XCRUSH_MATCH_INFO OptimizedMatches[1000]; 96 | }; 97 | typedef struct _XCRUSH_CONTEXT XCRUSH_CONTEXT; 98 | 99 | #ifdef __cplusplus 100 | extern "C" { 101 | #endif 102 | 103 | FREERDP_API int xcrush_compress(XCRUSH_CONTEXT* xcrush, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize, UINT32* pFlags); 104 | FREERDP_API int xcrush_decompress(XCRUSH_CONTEXT* xcrush, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize, UINT32 flags); 105 | 106 | FREERDP_API void xcrush_context_reset(XCRUSH_CONTEXT* xcrush, BOOL flush); 107 | 108 | FREERDP_API XCRUSH_CONTEXT* xcrush_context_new(BOOL Compressor); 109 | FREERDP_API void xcrush_context_free(XCRUSH_CONTEXT* xcrush); 110 | 111 | #ifdef __cplusplus 112 | } 113 | #endif 114 | 115 | #endif /* FREERDP_CODEC_XCRUSH_H */ 116 | 117 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/codec/zgfx.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * ZGFX (RDP8) Bulk Data Compression 4 | * 5 | * Copyright 2014 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_CODEC_ZGFX_H 21 | #define FREERDP_CODEC_ZGFX_H 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | #define ZGFX_SEGMENTED_SINGLE 0xE0 29 | #define ZGFX_SEGMENTED_MULTIPART 0xE1 30 | 31 | struct _ZGFX_CONTEXT 32 | { 33 | BOOL Compressor; 34 | 35 | BYTE* pbInputCurrent; 36 | BYTE* pbInputEnd; 37 | 38 | UINT32 bits; 39 | UINT32 cBitsRemaining; 40 | UINT32 BitsCurrent; 41 | UINT32 cBitsCurrent; 42 | 43 | BYTE OutputBuffer[65536]; 44 | UINT32 OutputCount; 45 | 46 | BYTE HistoryBuffer[2500000]; 47 | UINT32 HistoryIndex; 48 | UINT32 HistoryBufferSize; 49 | }; 50 | typedef struct _ZGFX_CONTEXT ZGFX_CONTEXT; 51 | 52 | #ifdef __cplusplus 53 | extern "C" { 54 | #endif 55 | 56 | FREERDP_API int zgfx_compress(ZGFX_CONTEXT* zgfx, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize, UINT32* pFlags); 57 | FREERDP_API int zgfx_decompress(ZGFX_CONTEXT* zgfx, BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize, UINT32 flags); 58 | 59 | FREERDP_API void zgfx_context_reset(ZGFX_CONTEXT* zgfx, BOOL flush); 60 | 61 | FREERDP_API ZGFX_CONTEXT* zgfx_context_new(BOOL Compressor); 62 | FREERDP_API void zgfx_context_free(ZGFX_CONTEXT* zgfx); 63 | 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | 68 | #endif /* FREERDP_CODEC_ZGFX_H */ 69 | 70 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/codecs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * RDP Codecs 4 | * 5 | * Copyright 2014 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_CODECS_H 21 | #define FREERDP_CODECS_H 22 | 23 | #include 24 | 25 | #include 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | #define FREERDP_CODEC_INTERLEAVED 0x00000001 36 | #define FREERDP_CODEC_PLANAR 0x00000002 37 | #define FREERDP_CODEC_NSCODEC 0x00000004 38 | #define FREERDP_CODEC_REMOTEFX 0x00000008 39 | #define FREERDP_CODEC_CLEARCODEC 0x00000010 40 | #define FREERDP_CODEC_ALPHACODEC 0x00000020 41 | #define FREERDP_CODEC_PROGRESSIVE 0x00000040 42 | #define FREERDP_CODEC_H264 0x00000080 43 | #define FREERDP_CODEC_ALL 0xFFFFFFFF 44 | 45 | struct rdp_codecs 46 | { 47 | rdpContext* context; 48 | 49 | RFX_CONTEXT* rfx; 50 | NSC_CONTEXT* nsc; 51 | H264_CONTEXT* h264; 52 | CLEAR_CONTEXT* clear; 53 | PROGRESSIVE_CONTEXT* progressive; 54 | BITMAP_PLANAR_CONTEXT* planar; 55 | BITMAP_INTERLEAVED_CONTEXT* interleaved; 56 | }; 57 | 58 | #ifdef __cplusplus 59 | extern "C" { 60 | #endif 61 | 62 | FREERDP_API BOOL freerdp_client_codecs_prepare(rdpCodecs* codecs, UINT32 flags); 63 | FREERDP_API BOOL freerdp_client_codecs_reset(rdpCodecs* codecs, UINT32 flags); 64 | 65 | FREERDP_API rdpCodecs* codecs_new(rdpContext* context); 66 | FREERDP_API void codecs_free(rdpCodecs* codecs); 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | 72 | #endif /* FREERDP_CODECS_H */ 73 | 74 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/constants.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * RDP Constants 4 | * 5 | * Copyright 2011 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_CONSTANTS_H 21 | #define FREERDP_CONSTANTS_H 22 | 23 | /** 24 | * Codec IDs 25 | */ 26 | enum RDP_CODEC_ID 27 | { 28 | RDP_CODEC_ID_NONE = 0x00, 29 | RDP_CODEC_ID_NSCODEC = 0x01, 30 | RDP_CODEC_ID_JPEG = 0x02, 31 | RDP_CODEC_ID_REMOTEFX = 0x03, 32 | RDP_CODEC_ID_IMAGE_REMOTEFX = 0x04 33 | }; 34 | 35 | /** 36 | * Pixel format 37 | */ 38 | enum RDP_PIXEL_FORMAT 39 | { 40 | RDP_PIXEL_FORMAT_B8G8R8A8, 41 | RDP_PIXEL_FORMAT_R8G8B8A8, 42 | RDP_PIXEL_FORMAT_B8G8R8, 43 | RDP_PIXEL_FORMAT_R8G8B8, 44 | RDP_PIXEL_FORMAT_B5G6R5_LE, 45 | RDP_PIXEL_FORMAT_R5G6B5_LE, 46 | RDP_PIXEL_FORMAT_P4_PLANER, 47 | RDP_PIXEL_FORMAT_P8 48 | }; 49 | typedef enum RDP_PIXEL_FORMAT RDP_PIXEL_FORMAT; 50 | 51 | /** 52 | * CPU Optimization flags 53 | */ 54 | #define CPU_SSE2 0x1 55 | 56 | /** 57 | * OSMajorType 58 | */ 59 | #define OSMAJORTYPE_UNSPECIFIED 0x0000 60 | #define OSMAJORTYPE_WINDOWS 0x0001 61 | #define OSMAJORTYPE_OS2 0x0002 62 | #define OSMAJORTYPE_MACINTOSH 0x0003 63 | #define OSMAJORTYPE_UNIX 0x0004 64 | 65 | /** 66 | * OSMinorType 67 | */ 68 | #define OSMINORTYPE_UNSPECIFIED 0x0000 69 | #define OSMINORTYPE_WINDOWS_31X 0x0001 70 | #define OSMINORTYPE_WINDOWS_95 0x0002 71 | #define OSMINORTYPE_WINDOWS_NT 0x0003 72 | #define OSMINORTYPE_OS2_V21 0x0004 73 | #define OSMINORTYPE_POWER_PC 0x0005 74 | #define OSMINORTYPE_MACINTOSH 0x0006 75 | #define OSMINORTYPE_NATIVE_XSERVER 0x0007 76 | #define OSMINORTYPE_PSEUDO_XSERVER 0x0008 77 | 78 | #endif /* FREERDP_CONSTANTS_H */ 79 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/crypto/certificate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Certificate Handling 4 | * 5 | * Copyright 2011-2012 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_CRYPTO_CERTIFICATE_H 21 | #define FREERDP_CRYPTO_CERTIFICATE_H 22 | 23 | typedef struct rdp_certificate_data rdpCertificateData; 24 | typedef struct rdp_certificate_store rdpCertificateStore; 25 | 26 | #include 27 | #include 28 | 29 | #include 30 | #include 31 | 32 | #include 33 | #include 34 | 35 | struct rdp_certificate_data 36 | { 37 | char* hostname; 38 | UINT16 port; 39 | char* subject; 40 | char* issuer; 41 | char* fingerprint; 42 | }; 43 | 44 | struct rdp_certificate_store 45 | { 46 | char* path; 47 | char* file; 48 | char* legacy_file; 49 | rdpSettings* settings; 50 | rdpCertificateData* certificate_data; 51 | }; 52 | 53 | #ifdef __cplusplus 54 | extern "C" { 55 | #endif 56 | 57 | FREERDP_API rdpCertificateData* certificate_data_new( 58 | char* hostname, UINT16 port, char* subject, 59 | char* issuer, char* fingerprint); 60 | FREERDP_API void certificate_data_free( 61 | rdpCertificateData* certificate_data); 62 | FREERDP_API rdpCertificateStore* certificate_store_new( 63 | rdpSettings* settings); 64 | FREERDP_API BOOL certificate_data_replace( 65 | rdpCertificateStore* certificate_store, 66 | rdpCertificateData* certificate_data); 67 | FREERDP_API void certificate_store_free( 68 | rdpCertificateStore* certificate_store); 69 | FREERDP_API int certificate_data_match( 70 | rdpCertificateStore* certificate_store, 71 | rdpCertificateData* certificate_data); 72 | FREERDP_API BOOL certificate_data_print( 73 | rdpCertificateStore* certificate_store, 74 | rdpCertificateData* certificate_data); 75 | FREERDP_API BOOL certificate_get_stored_data( 76 | rdpCertificateStore* certificate_store, 77 | rdpCertificateData* certificate_data, 78 | char** subject, char** issuer, 79 | char** fingerprint); 80 | 81 | #ifdef __cplusplus 82 | } 83 | #endif 84 | 85 | #endif /* FREERDP_CRYPTO_CERTIFICATE_H */ 86 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/crypto/crypto.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Cryptographic Abstraction Layer 4 | * 5 | * Copyright 2011-2012 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_CRYPTO_H 21 | #define FREERDP_CRYPTO_H 22 | 23 | /* OpenSSL includes windows.h */ 24 | #include 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x0090800f) 32 | #define D2I_X509_CONST const 33 | #else 34 | #define D2I_X509_CONST 35 | #endif 36 | 37 | #define EXPONENT_MAX_SIZE 4 38 | 39 | #include 40 | #include 41 | #include 42 | 43 | struct crypto_cert_struct 44 | { 45 | X509 * px509; 46 | STACK_OF(X509) *px509chain; 47 | }; 48 | 49 | #ifdef __cplusplus 50 | extern "C" { 51 | #endif 52 | 53 | typedef struct crypto_cert_struct* CryptoCert; 54 | 55 | FREERDP_API CryptoCert crypto_cert_read(BYTE* data, UINT32 length); 56 | FREERDP_API char* crypto_cert_fingerprint(X509* xcert); 57 | FREERDP_API char* crypto_cert_subject(X509* xcert); 58 | FREERDP_API char* crypto_cert_subject_common_name(X509* xcert, int* length); 59 | FREERDP_API char** crypto_cert_subject_alt_name(X509* xcert, int* count, 60 | int** lengths); 61 | FREERDP_API void crypto_cert_subject_alt_name_free(int count, int *lengths, 62 | char** alt_name); 63 | FREERDP_API char* crypto_cert_issuer(X509* xcert); 64 | FREERDP_API void crypto_cert_print_info(X509* xcert); 65 | FREERDP_API void crypto_cert_free(CryptoCert cert); 66 | 67 | FREERDP_API BOOL x509_verify_certificate(CryptoCert cert, char* certificate_store_path); 68 | FREERDP_API rdpCertificateData* crypto_get_certificate_data(X509* xcert, char* hostname, UINT16 port); 69 | FREERDP_API BOOL crypto_cert_get_public_key(CryptoCert cert, BYTE** PublicKey, DWORD* PublicKeyLength); 70 | 71 | #define TSSK_KEY_LENGTH 64 72 | extern const BYTE tssk_modulus[]; 73 | extern const BYTE tssk_privateExponent[]; 74 | extern const BYTE tssk_exponent[]; 75 | 76 | FREERDP_API int crypto_rsa_public_encrypt(const BYTE* input, int length, UINT32 key_length, const BYTE* modulus, const BYTE* exponent, BYTE* output); 77 | FREERDP_API int crypto_rsa_public_decrypt(const BYTE* input, int length, UINT32 key_length, const BYTE* modulus, const BYTE* exponent, BYTE* output); 78 | FREERDP_API int crypto_rsa_private_encrypt(const BYTE* input, int length, UINT32 key_length, const BYTE* modulus, const BYTE* private_exponent, BYTE* output); 79 | FREERDP_API int crypto_rsa_private_decrypt(const BYTE* input, int length, UINT32 key_length, const BYTE* modulus, const BYTE* private_exponent, BYTE* output); 80 | FREERDP_API void crypto_reverse(BYTE* data, int length); 81 | 82 | FREERDP_API char* crypto_base64_encode(const BYTE* data, int length); 83 | FREERDP_API void crypto_base64_decode(const char* enc_data, int length, BYTE** dec_data, int* res_length); 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | 89 | #endif /* FREERDP_CRYPTO_H */ 90 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/crypto/der.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * ASN.1 Basic Encoding Rules (DER) 4 | * 5 | * Copyright 2011 Samsung, Author Jiten Pathy 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_CRYPTO_DER_H 21 | #define FREERDP_CRYPTO_DER_H 22 | 23 | #include 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | FREERDP_API int _der_skip_length(int length); 30 | FREERDP_API int der_write_length(wStream* s, int length); 31 | FREERDP_API int der_get_content_length(int length); 32 | FREERDP_API int der_skip_octet_string(int length); 33 | FREERDP_API int der_skip_sequence_tag(int length); 34 | FREERDP_API int der_write_sequence_tag(wStream* s, int length); 35 | FREERDP_API int der_skip_contextual_tag(int length); 36 | FREERDP_API int der_write_contextual_tag(wStream* s, BYTE tag, int length, BOOL pc); 37 | FREERDP_API void der_write_octet_string(wStream* s, BYTE* oct_str, int length); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif /* FREERDP_CRYPTO_DER_H */ 44 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/crypto/per.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * ASN.1 Packed Encoding Rules (BER) 4 | * 5 | * Copyright 2011-2012 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_CRYPTO_PER_H 21 | #define FREERDP_CRYPTO_PER_H 22 | 23 | #include 24 | 25 | #include 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | FREERDP_API BOOL per_read_length(wStream* s, UINT16* length); 32 | FREERDP_API void per_write_length(wStream* s, int length); 33 | FREERDP_API BOOL per_read_choice(wStream* s, BYTE* choice); 34 | FREERDP_API void per_write_choice(wStream* s, BYTE choice); 35 | FREERDP_API BOOL per_read_selection(wStream* s, BYTE* selection); 36 | FREERDP_API void per_write_selection(wStream* s, BYTE selection); 37 | FREERDP_API BOOL per_read_number_of_sets(wStream* s, BYTE* number); 38 | FREERDP_API void per_write_number_of_sets(wStream* s, BYTE number); 39 | FREERDP_API BOOL per_read_padding(wStream* s, int length); 40 | FREERDP_API void per_write_padding(wStream* s, int length); 41 | FREERDP_API BOOL per_read_integer(wStream* s, UINT32* integer); 42 | FREERDP_API BOOL per_read_integer16(wStream* s, UINT16* integer, UINT16 min); 43 | FREERDP_API void per_write_integer(wStream* s, UINT32 integer); 44 | FREERDP_API void per_write_integer16(wStream* s, UINT16 integer, UINT16 min); 45 | FREERDP_API BOOL per_read_enumerated(wStream* s, BYTE* enumerated, BYTE count); 46 | FREERDP_API void per_write_enumerated(wStream* s, BYTE enumerated, BYTE count); 47 | FREERDP_API void per_write_object_identifier(wStream* s, BYTE oid[6]); 48 | FREERDP_API BOOL per_read_object_identifier(wStream* s, BYTE oid[6]); 49 | FREERDP_API BOOL per_read_octet_string(wStream* s, BYTE* oct_str, int length, int min); 50 | FREERDP_API void per_write_octet_string(wStream* s, BYTE* oct_str, int length, int min); 51 | FREERDP_API BOOL per_read_numeric_string(wStream* s, int min); 52 | FREERDP_API void per_write_numeric_string(wStream* s, BYTE* num_str, int length, int min); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif /* FREERDP_CRYPTO_PER_H */ 59 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/event.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Event Definitions 4 | * 5 | * Copyright 2013 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_EVENT_H 21 | #define FREERDP_EVENT_H 22 | 23 | #include 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | #define FREERDP_WINDOW_STATE_NORMAL 0 31 | #define FREERDP_WINDOW_STATE_MINIMIZED 1 32 | #define FREERDP_WINDOW_STATE_MAXIMIZED 2 33 | #define FREERDP_WINDOW_STATE_FULLSCREEN 3 34 | #define FREERDP_WINDOW_STATE_ACTIVE 4 35 | 36 | DEFINE_EVENT_BEGIN(WindowStateChange) 37 | int state; 38 | DEFINE_EVENT_END(WindowStateChange) 39 | 40 | DEFINE_EVENT_BEGIN(ResizeWindow) 41 | int width; 42 | int height; 43 | DEFINE_EVENT_END(ResizeWindow) 44 | 45 | DEFINE_EVENT_BEGIN(PanningChange) 46 | int dx; 47 | int dy; 48 | DEFINE_EVENT_END(PanningChange) 49 | 50 | DEFINE_EVENT_BEGIN(ZoomingChange) 51 | int dx; 52 | int dy; 53 | DEFINE_EVENT_END(ZoomingChange) 54 | 55 | DEFINE_EVENT_BEGIN(LocalResizeWindow) 56 | int width; 57 | int height; 58 | DEFINE_EVENT_END(LocalResizeWindow) 59 | 60 | DEFINE_EVENT_BEGIN(EmbedWindow) 61 | BOOL embed; 62 | void* handle; 63 | DEFINE_EVENT_END(EmbedWindow) 64 | 65 | DEFINE_EVENT_BEGIN(ErrorInfo) 66 | UINT32 code; 67 | DEFINE_EVENT_END(ErrorInfo) 68 | 69 | DEFINE_EVENT_BEGIN(Terminate) 70 | int code; 71 | DEFINE_EVENT_END(Terminate) 72 | 73 | DEFINE_EVENT_BEGIN(ConnectionResult) 74 | int result; 75 | DEFINE_EVENT_END(ConnectionResult) 76 | 77 | DEFINE_EVENT_BEGIN(ChannelConnected) 78 | const char* name; 79 | void* pInterface; 80 | DEFINE_EVENT_END(ChannelConnected) 81 | 82 | DEFINE_EVENT_BEGIN(ChannelDisconnected) 83 | const char* name; 84 | void* pInterface; 85 | DEFINE_EVENT_END(ChannelDisconnected) 86 | 87 | DEFINE_EVENT_BEGIN(MouseEvent) 88 | UINT16 flags; 89 | UINT16 x; 90 | UINT16 y; 91 | DEFINE_EVENT_END(MouseEvent) 92 | 93 | #ifdef __cplusplus 94 | } 95 | #endif 96 | 97 | #endif /* FREERDP_EVENT_H */ 98 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/extension.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * RDP Extensions 4 | * 5 | * Copyright 2010-2011 Vic Lee 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_EXTENSION_H 21 | #define FREERDP_EXTENSION_H 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #define FREERDP_EXT_EXPORT_FUNC_NAME "FreeRDPExtensionEntry" 28 | 29 | typedef struct rdp_ext_plugin rdpExtPlugin; 30 | 31 | struct rdp_ext_plugin 32 | { 33 | void* ext; 34 | int (*init) (rdpExtPlugin* plugin, freerdp* instance); 35 | int (*uninit) (rdpExtPlugin* plugin, freerdp* instance); 36 | }; 37 | 38 | typedef UINT32 (FREERDP_CC* PFREERDP_EXTENSION_HOOK)(rdpExtPlugin* plugin, freerdp* instance); 39 | 40 | typedef UINT32 (FREERDP_CC* PREGISTEREXTENSION)(rdpExtPlugin* plugin); 41 | typedef UINT32 (FREERDP_CC* PREGISTERPRECONNECTHOOK)(rdpExtPlugin* plugin, PFREERDP_EXTENSION_HOOK hook); 42 | typedef UINT32 (FREERDP_CC* PREGISTERPOSTCONNECTHOOK)(rdpExtPlugin* plugin, PFREERDP_EXTENSION_HOOK hook); 43 | 44 | struct _FREERDP_EXTENSION_ENTRY_POINTS 45 | { 46 | void* ext; /* Reference to internal instance */ 47 | PREGISTEREXTENSION pRegisterExtension; 48 | PREGISTERPRECONNECTHOOK pRegisterPreConnectHook; 49 | PREGISTERPOSTCONNECTHOOK pRegisterPostConnectHook; 50 | void* data; 51 | }; 52 | 53 | typedef struct _FREERDP_EXTENSION_ENTRY_POINTS FREERDP_EXTENSION_ENTRY_POINTS; 54 | typedef FREERDP_EXTENSION_ENTRY_POINTS* PFREERDP_EXTENSION_ENTRY_POINTS; 55 | 56 | typedef int (FREERDP_CC* PFREERDP_EXTENSION_ENTRY)(PFREERDP_EXTENSION_ENTRY_POINTS pEntryPoints); 57 | 58 | #endif /* FREERDP_EXTENSION_H */ 59 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/gdi/16bpp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * GDI 16bpp Internal Buffer Routines 4 | * 5 | * Copyright 2010-2011 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_GDI_16BPP_H 21 | #define FREERDP_GDI_16BPP_H 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | typedef BOOL (*pLineTo_16bpp)(HGDI_DC hdc, int nXEnd, int nYEnd); 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | FREERDP_API UINT16 gdi_get_color_16bpp(HGDI_DC hdc, GDI_COLOR color); 34 | 35 | FREERDP_API BOOL FillRect_16bpp(HGDI_DC hdc, HGDI_RECT rect, HGDI_BRUSH hbr); 36 | FREERDP_API BOOL BitBlt_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc, DWORD rop); 37 | FREERDP_API BOOL PatBlt_16bpp(HGDI_DC hdc, int nXLeft, int nYLeft, int nWidth, int nHeight, DWORD rop); 38 | FREERDP_API BOOL LineTo_16bpp(HGDI_DC hdc, int nXEnd, int nYEnd); 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif /* FREERDP_GDI_16BPP_H */ 45 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/gdi/32bpp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * GDI 32bpp Internal Buffer Routines 4 | * 5 | * Copyright 2010-2011 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_GDI_32BPP_H 21 | #define FREERDP_GDI_32BPP_H 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | typedef BOOL (*pLineTo_32bpp)(HGDI_DC hdc, int nXEnd, int nYEnd); 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | FREERDP_API UINT32 gdi_get_color_32bpp(HGDI_DC hdc, GDI_COLOR color); 34 | 35 | FREERDP_API BOOL FillRect_32bpp(HGDI_DC hdc, HGDI_RECT rect, HGDI_BRUSH hbr); 36 | FREERDP_API BOOL BitBlt_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc, DWORD rop); 37 | FREERDP_API BOOL PatBlt_32bpp(HGDI_DC hdc, int nXLeft, int nYLeft, int nWidth, int nHeight, DWORD rop); 38 | FREERDP_API BOOL LineTo_32bpp(HGDI_DC hdc, int nXEnd, int nYEnd); 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif /* FREERDP_GDI_32BPP_H */ 45 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/gdi/8bpp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * GDI 8bpp Internal Buffer Routines 4 | * 5 | * Copyright 2010-2011 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_GDI_8BPP_H 21 | #define FREERDP_GDI_8BPP_H 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | typedef BOOL (*pLineTo_8bpp)(HGDI_DC hdc, int nXEnd, int nYEnd); 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | FREERDP_API BYTE gdi_get_color_8bpp(HGDI_DC hdc, GDI_COLOR color); 34 | 35 | FREERDP_API BOOL FillRect_8bpp(HGDI_DC hdc, HGDI_RECT rect, HGDI_BRUSH hbr); 36 | FREERDP_API BOOL BitBlt_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc, DWORD rop); 37 | FREERDP_API BOOL PatBlt_8bpp(HGDI_DC hdc, int nXLeft, int nYLeft, int nWidth, int nHeight, DWORD rop); 38 | FREERDP_API BOOL LineTo_8bpp(HGDI_DC hdc, int nXEnd, int nYEnd); 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif /* FREERDP_GDI_8BPP_H */ 45 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/gdi/bitmap.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * GDI Bitmap Functions 4 | * 5 | * Copyright 2010-2011 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_GDI_BITMAP_H 21 | #define FREERDP_GDI_BITMAP_H 22 | 23 | #include 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | FREERDP_API GDI_COLOR gdi_GetPixel(HGDI_DC hdc, int nXPos, int nYPos); 31 | FREERDP_API GDI_COLOR gdi_SetPixel(HGDI_DC hdc, int X, int Y, GDI_COLOR crColor); 32 | FREERDP_API BYTE gdi_GetPixel_8bpp(HGDI_BITMAP hBmp, int X, int Y); 33 | FREERDP_API UINT16 gdi_GetPixel_16bpp(HGDI_BITMAP hBmp, int X, int Y); 34 | FREERDP_API UINT32 gdi_GetPixel_32bpp(HGDI_BITMAP hBmp, int X, int Y); 35 | FREERDP_API BYTE* gdi_GetPointer_8bpp(HGDI_BITMAP hBmp, int X, int Y); 36 | FREERDP_API UINT16* gdi_GetPointer_16bpp(HGDI_BITMAP hBmp, int X, int Y); 37 | FREERDP_API UINT32* gdi_GetPointer_32bpp(HGDI_BITMAP hBmp, int X, int Y); 38 | FREERDP_API void gdi_SetPixel_8bpp(HGDI_BITMAP hBmp, int X, int Y, BYTE pixel); 39 | FREERDP_API void gdi_SetPixel_16bpp(HGDI_BITMAP hBmp, int X, int Y, UINT16 pixel); 40 | FREERDP_API void gdi_SetPixel_32bpp(HGDI_BITMAP hBmp, int X, int Y, UINT32 pixel); 41 | FREERDP_API HGDI_BITMAP gdi_CreateBitmap(int nWidth, int nHeight, int cBitsPerPixel, 42 | BYTE* data); 43 | FREERDP_API HGDI_BITMAP gdi_CreateBitmapEx(int nWidth, int nHeight, int cBitsPerPixel, 44 | BYTE* data, void (*fkt_free)(void*)); 45 | FREERDP_API HGDI_BITMAP gdi_CreateCompatibleBitmap(HGDI_DC hdc, int nWidth, int nHeight); 46 | FREERDP_API BOOL gdi_BitBlt(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc, DWORD rop); 47 | 48 | typedef BOOL (*p_BitBlt)(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc, DWORD rop); 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif /* FREERDP_GDI_BITMAP_H */ 55 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/gdi/brush.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * GDI Brush Functions 4 | * 5 | * Copyright 2010-2011 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_GDI_BRUSH_H 21 | #define FREERDP_GDI_BRUSH_H 22 | 23 | #include 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | FREERDP_API HGDI_BRUSH gdi_CreateSolidBrush(GDI_COLOR crColor); 31 | FREERDP_API HGDI_BRUSH gdi_CreatePatternBrush(HGDI_BITMAP hbmp); 32 | FREERDP_API HGDI_BRUSH gdi_CreateHatchBrush(HGDI_BITMAP hbmp); 33 | FREERDP_API BOOL gdi_PatBlt(HGDI_DC hdc, int nXLeft, int nYLeft, int nWidth, int nHeight, DWORD rop); 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | typedef BOOL (*p_PatBlt)(HGDI_DC hdc, int nXLeft, int nYLeft, int nWidth, int nHeight, DWORD rop); 40 | 41 | #endif /* FREERDP_GDI_BRUSH_H */ 42 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/gdi/clipping.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * GDI Clipping Functions 4 | * 5 | * Copyright 2010-2011 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_GDI_CLIPPING_H 21 | #define FREERDP_GDI_CLIPPING_H 22 | 23 | #include 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | FREERDP_API BOOL gdi_SetClipRgn(HGDI_DC hdc, int nXLeft, int nYLeft, int nWidth, int nHeight); 31 | FREERDP_API HGDI_RGN gdi_GetClipRgn(HGDI_DC hdc); 32 | FREERDP_API BOOL gdi_SetNullClipRgn(HGDI_DC hdc); 33 | FREERDP_API BOOL gdi_ClipCoords(HGDI_DC hdc, int *x, int *y, int *w, int *h, int *srcx, int *srcy); 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif /* FREERDP_GDI_CLIPPING_H */ 40 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/gdi/dc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * GDI Device Context Functions 4 | * 5 | * Copyright 2010-2011 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_GDI_DC_H 21 | #define FREERDP_GDI_DC_H 22 | 23 | #include 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | FREERDP_API HGDI_DC gdi_GetDC(void); 31 | FREERDP_API HGDI_DC gdi_CreateDC(UINT32 flags, int bpp); 32 | FREERDP_API HGDI_DC gdi_CreateCompatibleDC(HGDI_DC hdc); 33 | FREERDP_API HGDIOBJECT gdi_SelectObject(HGDI_DC hdc, HGDIOBJECT hgdiobject); 34 | FREERDP_API BOOL gdi_DeleteObject(HGDIOBJECT hgdiobject); 35 | FREERDP_API BOOL gdi_DeleteDC(HGDI_DC hdc); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif /* FREERDP_GDI_DC_H */ 42 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/gdi/drawing.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * GDI Drawing Functions 4 | * 5 | * Copyright 2010-2011 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_GDI_DRAWING_H 21 | #define FREERDP_GDI_DRAWING_H 22 | 23 | #include 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | FREERDP_API int gdi_GetROP2(HGDI_DC hdc); 31 | FREERDP_API int gdi_SetROP2(HGDI_DC hdc, int fnDrawMode); 32 | FREERDP_API GDI_COLOR gdi_GetBkColor(HGDI_DC hdc); 33 | FREERDP_API GDI_COLOR gdi_SetBkColor(HGDI_DC hdc, GDI_COLOR crColor); 34 | FREERDP_API int gdi_GetBkMode(HGDI_DC hdc); 35 | FREERDP_API int gdi_SetBkMode(HGDI_DC hdc, int iBkMode); 36 | FREERDP_API GDI_COLOR gdi_SetTextColor(HGDI_DC hdc, GDI_COLOR crColor); 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif /* FREERDP_GDI_DRAWING_H */ 43 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/gdi/gfx.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * GDI Graphics Pipeline 4 | * 5 | * Copyright 2014 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_GDI_GFX_H 21 | #define FREERDP_GDI_GFX_H 22 | 23 | #include 24 | #include 25 | 26 | struct gdi_gfx_surface 27 | { 28 | UINT16 surfaceId; 29 | rdpCodecs* codecs; 30 | UINT32 width; 31 | UINT32 height; 32 | BOOL alpha; 33 | BYTE* data; 34 | int scanline; 35 | UINT32 format; 36 | BOOL outputMapped; 37 | UINT32 outputOriginX; 38 | UINT32 outputOriginY; 39 | REGION16 invalidRegion; 40 | }; 41 | typedef struct gdi_gfx_surface gdiGfxSurface; 42 | 43 | struct gdi_gfx_cache_entry 44 | { 45 | UINT64 cacheKey; 46 | UINT32 width; 47 | UINT32 height; 48 | BOOL alpha; 49 | BYTE* data; 50 | int scanline; 51 | UINT32 format; 52 | }; 53 | typedef struct gdi_gfx_cache_entry gdiGfxCacheEntry; 54 | 55 | #ifdef __cplusplus 56 | extern "C" { 57 | #endif 58 | 59 | FREERDP_API void gdi_graphics_pipeline_init(rdpGdi* gdi, RdpgfxClientContext* gfx); 60 | FREERDP_API void gdi_graphics_pipeline_uninit(rdpGdi* gdi, RdpgfxClientContext* gfx); 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif /* FREERDP_GDI_GFX_H */ 67 | 68 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/gdi/line.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * GDI Line Functions 4 | * 5 | * Copyright 2010-2011 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_GDI_LINE_H 21 | #define FREERDP_GDI_LINE_H 22 | 23 | #include 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | FREERDP_API BOOL gdi_LineTo(HGDI_DC hdc, int nXEnd, int nYEnd); 31 | FREERDP_API BOOL gdi_PolylineTo(HGDI_DC hdc, GDI_POINT *lppt, DWORD cCount); 32 | FREERDP_API BOOL gdi_Polyline(HGDI_DC hdc, GDI_POINT *lppt, int cPoints); 33 | FREERDP_API BOOL gdi_PolyPolyline(HGDI_DC hdc, GDI_POINT *lppt, int *lpdwPolyPoints, DWORD cCount); 34 | FREERDP_API BOOL gdi_MoveToEx(HGDI_DC hdc, int X, int Y, HGDI_POINT lpPoint); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | typedef BOOL (*p_LineTo)(HGDI_DC hdc, int nXEnd, int nYEnd); 41 | 42 | #endif /* FREERDP_GDI_LINE_H */ 43 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/gdi/palette.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * GDI Palette Functions 4 | * 5 | * Copyright 2010-2011 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_GDI_PALETTE_H 21 | #define FREERDP_GDI_PALETTE_H 22 | 23 | #include 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | FREERDP_API HGDI_PALETTE gdi_CreatePalette(HGDI_PALETTE palette); 31 | FREERDP_API HGDI_PALETTE gdi_GetSystemPalette(void); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif /* FREERDP_GDI_PALETTE_H */ 38 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/gdi/pen.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * GDI Pen Functions 4 | * 5 | * Copyright 2010-2011 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_GDI_PEN_H 21 | #define FREERDP_GDI_PEN_H 22 | 23 | #include 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | FREERDP_API HGDI_PEN gdi_CreatePen(int fnPenStyle, int nWidth, int crColor); 31 | FREERDP_API BYTE gdi_GetPenColor_8bpp(HGDI_PEN pen); 32 | FREERDP_API UINT16 gdi_GetPenColor_16bpp(HGDI_PEN pen); 33 | FREERDP_API UINT32 gdi_GetPenColor_32bpp(HGDI_PEN pen); 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif /* FREERDP_GDI_PEN_H */ 40 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/gdi/region.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * GDI Region Functions 4 | * 5 | * Copyright 2010-2011 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_GDI_REGION_H 21 | #define FREERDP_GDI_REGION_H 22 | 23 | #include 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | FREERDP_API HGDI_RGN gdi_CreateRectRgn(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect); 31 | FREERDP_API HGDI_RECT gdi_CreateRect(int xLeft, int yTop, int xRight, int yBottom); 32 | FREERDP_API void gdi_RectToRgn(HGDI_RECT rect, HGDI_RGN rgn); 33 | FREERDP_API void gdi_CRectToRgn(int left, int top, int right, int bottom, HGDI_RGN rgn); 34 | FREERDP_API void gdi_RectToCRgn(HGDI_RECT rect, int *x, int *y, int *w, int *h); 35 | FREERDP_API void gdi_CRectToCRgn(int left, int top, int right, int bottom, int *x, int *y, int *w, int *h); 36 | FREERDP_API void gdi_RgnToRect(HGDI_RGN rgn, HGDI_RECT rect); 37 | FREERDP_API void gdi_CRgnToRect(int x, int y, int w, int h, HGDI_RECT rect); 38 | FREERDP_API void gdi_RgnToCRect(HGDI_RGN rgn, int *left, int *top, int *right, int *bottom); 39 | FREERDP_API void gdi_CRgnToCRect(int x, int y, int w, int h, int *left, int *top, int *right, int *bottom); 40 | FREERDP_API BOOL gdi_CopyOverlap(int x, int y, int width, int height, int srcx, int srcy); 41 | FREERDP_API BOOL gdi_SetRect(HGDI_RECT rc, int xLeft, int yTop, int xRight, int yBottom); 42 | FREERDP_API BOOL gdi_SetRgn(HGDI_RGN hRgn, int nXLeft, int nYLeft, int nWidth, int nHeight); 43 | FREERDP_API BOOL gdi_SetRectRgn(HGDI_RGN hRgn, int nLeftRect, int nTopRect, int nRightRect, int nBottomRect); 44 | FREERDP_API BOOL gdi_EqualRgn(HGDI_RGN hSrcRgn1, HGDI_RGN hSrcRgn2); 45 | FREERDP_API BOOL gdi_CopyRect(HGDI_RECT dst, HGDI_RECT src); 46 | FREERDP_API BOOL gdi_PtInRect(HGDI_RECT rc, int x, int y); 47 | FREERDP_API BOOL gdi_InvalidateRegion(HGDI_DC hdc, int x, int y, int w, int h); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif /* FREERDP_GDI_REGION_H */ 54 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/gdi/shape.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * GDI Shape Functions 4 | * 5 | * Copyright 2010-2011 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_GDI_SHAPE_H 21 | #define FREERDP_GDI_SHAPE_H 22 | 23 | #include 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | FREERDP_API BOOL gdi_Ellipse(HGDI_DC hdc, int nLeftRect, int nTopRect, int nRightRect, int nBottomRect); 31 | FREERDP_API BOOL gdi_FillRect(HGDI_DC hdc, HGDI_RECT rect, HGDI_BRUSH hbr); 32 | FREERDP_API BOOL gdi_Polygon(HGDI_DC hdc, GDI_POINT *lpPoints, int nCount); 33 | FREERDP_API BOOL gdi_PolyPolygon(HGDI_DC hdc, GDI_POINT *lpPoints, int *lpPolyCounts, int nCount); 34 | FREERDP_API BOOL gdi_Rectangle(HGDI_DC hdc, int nLeftRect, int nTopRect, int nRightRect, int nBottomRect); 35 | 36 | typedef BOOL (*p_FillRect)(HGDI_DC hdc, HGDI_RECT rect, HGDI_BRUSH hbr); 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif /* FREERDP_GDI_SHAPE_H */ 43 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/listener.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * RDP Server Listener 4 | * 5 | * Copyright 2011 Vic Lee 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_LISTENER_H 21 | #define FREERDP_LISTENER_H 22 | 23 | typedef struct rdp_freerdp_listener freerdp_listener; 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | typedef BOOL (*psListenerOpen)(freerdp_listener* instance, const char* bind_address, UINT16 port); 35 | typedef BOOL (*psListenerOpenLocal)(freerdp_listener* instance, const char* path); 36 | typedef BOOL (*psListenerOpenFromSocket)(freerdp_listener* instance, int fd); 37 | typedef BOOL (*psListenerGetFileDescriptor)(freerdp_listener* instance, void** rfds, int* rcount); 38 | typedef DWORD (*psListenerGetEventHandles)(freerdp_listener* instance, HANDLE* events, DWORD nCount); 39 | typedef BOOL (*psListenerCheckFileDescriptor)(freerdp_listener* instance); 40 | typedef void (*psListenerClose)(freerdp_listener* instance); 41 | typedef BOOL (*psPeerAccepted)(freerdp_listener* instance, freerdp_peer* client); 42 | 43 | struct rdp_freerdp_listener 44 | { 45 | void* info; 46 | void* listener; 47 | void* param1; 48 | void* param2; 49 | void* param3; 50 | void* param4; 51 | 52 | psListenerOpen Open; 53 | psListenerOpenLocal OpenLocal; 54 | psListenerGetFileDescriptor GetFileDescriptor; 55 | psListenerGetEventHandles GetEventHandles; 56 | psListenerCheckFileDescriptor CheckFileDescriptor; 57 | psListenerClose Close; 58 | 59 | psPeerAccepted PeerAccepted; 60 | psListenerOpenFromSocket OpenFromSocket; 61 | }; 62 | 63 | FREERDP_API freerdp_listener* freerdp_listener_new(void); 64 | FREERDP_API void freerdp_listener_free(freerdp_listener* instance); 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif /* FREERDP_LISTENER_H */ 71 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/log.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * FreeRDP log defines 4 | * 5 | * Copyright 2014 Armin Novak 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_LOG_H 21 | #define FREERDP_LOG_H 22 | 23 | #include 24 | 25 | #define FREERDP_TAG(tag) "com.freerdp." tag 26 | #define SERVER_TAG(tag) FREERDP_TAG("server.") tag 27 | #define CLIENT_TAG(tag) FREERDP_TAG("client.") tag 28 | 29 | #endif /* FREERDP_UTILS_DEBUG_H */ 30 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/metrics.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Protocol Metrics 4 | * 5 | * Copyright 2014 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_METRICS_H 21 | #define FREERDP_METRICS_H 22 | 23 | #include 24 | 25 | struct rdp_metrics 26 | { 27 | rdpContext* context; 28 | 29 | UINT64 TotalCompressedBytes; 30 | UINT64 TotalUncompressedBytes; 31 | double TotalCompressionRatio; 32 | }; 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | FREERDP_API double metrics_write_bytes(rdpMetrics* metrics, UINT32 UncompressedBytes, UINT32 CompressedBytes); 39 | 40 | FREERDP_API rdpMetrics* metrics_new(rdpContext* context); 41 | FREERDP_API void metrics_free(rdpMetrics* metrics); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif /* FREERDP_METRICS_H */ 48 | 49 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/pointer.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Pointer Updates Interface API 4 | * 5 | * Copyright 2011 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_UPDATE_POINTER_H 21 | #define FREERDP_UPDATE_POINTER_H 22 | 23 | #include 24 | 25 | #define PTR_MSG_TYPE_SYSTEM 0x0001 26 | #define PTR_MSG_TYPE_POSITION 0x0003 27 | #define PTR_MSG_TYPE_COLOR 0x0006 28 | #define PTR_MSG_TYPE_CACHED 0x0007 29 | #define PTR_MSG_TYPE_POINTER 0x0008 30 | 31 | #define SYSPTR_NULL 0x00000000 32 | #define SYSPTR_DEFAULT 0x00007F00 33 | 34 | struct _POINTER_POSITION_UPDATE 35 | { 36 | UINT32 xPos; 37 | UINT32 yPos; 38 | }; 39 | typedef struct _POINTER_POSITION_UPDATE POINTER_POSITION_UPDATE; 40 | 41 | struct _POINTER_SYSTEM_UPDATE 42 | { 43 | UINT32 type; 44 | }; 45 | typedef struct _POINTER_SYSTEM_UPDATE POINTER_SYSTEM_UPDATE; 46 | 47 | struct _POINTER_COLOR_UPDATE 48 | { 49 | UINT32 cacheIndex; 50 | UINT32 xPos; 51 | UINT32 yPos; 52 | UINT32 width; 53 | UINT32 height; 54 | UINT32 lengthAndMask; 55 | UINT32 lengthXorMask; 56 | BYTE* xorMaskData; 57 | BYTE* andMaskData; 58 | }; 59 | typedef struct _POINTER_COLOR_UPDATE POINTER_COLOR_UPDATE; 60 | 61 | struct _POINTER_NEW_UPDATE 62 | { 63 | UINT32 xorBpp; 64 | POINTER_COLOR_UPDATE colorPtrAttr; 65 | }; 66 | typedef struct _POINTER_NEW_UPDATE POINTER_NEW_UPDATE; 67 | 68 | struct _POINTER_CACHED_UPDATE 69 | { 70 | UINT32 cacheIndex; 71 | }; 72 | typedef struct _POINTER_CACHED_UPDATE POINTER_CACHED_UPDATE; 73 | 74 | typedef BOOL (*pPointerPosition)(rdpContext* context, POINTER_POSITION_UPDATE* pointer_position); 75 | typedef BOOL (*pPointerSystem)(rdpContext* context, POINTER_SYSTEM_UPDATE* pointer_system); 76 | typedef BOOL (*pPointerColor)(rdpContext* context, POINTER_COLOR_UPDATE* pointer_color); 77 | typedef BOOL (*pPointerNew)(rdpContext* context, POINTER_NEW_UPDATE* pointer_new); 78 | typedef BOOL (*pPointerCached)(rdpContext* context, POINTER_CACHED_UPDATE* pointer_cached); 79 | 80 | struct rdp_pointer_update 81 | { 82 | rdpContext* context; /* 0 */ 83 | UINT32 paddingA[16 - 1]; /* 1 */ 84 | 85 | pPointerPosition PointerPosition; /* 16 */ 86 | pPointerSystem PointerSystem; /* 17 */ 87 | pPointerColor PointerColor; /* 18 */ 88 | pPointerNew PointerNew; /* 19 */ 89 | pPointerCached PointerCached; /* 20 */ 90 | UINT32 paddingB[32 - 21]; /* 21 */ 91 | 92 | /* internal */ 93 | 94 | POINTER_POSITION_UPDATE pointer_position; 95 | POINTER_SYSTEM_UPDATE pointer_system; 96 | POINTER_COLOR_UPDATE pointer_color; 97 | POINTER_NEW_UPDATE pointer_new; 98 | POINTER_CACHED_UPDATE pointer_cached; 99 | }; 100 | typedef struct rdp_pointer_update rdpPointerUpdate; 101 | 102 | #endif /* FREERDP_UPDATE_POINTER_H */ 103 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/server/channels.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Server Channels 4 | * 5 | * Copyright 2012 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_CHANNELS_SERVER 21 | #define FREERDP_CHANNELS_SERVER 22 | 23 | #include 24 | 25 | #endif /* FREERDP_CHANNELS_SERVER */ 26 | 27 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/server/drdynvc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Dynamic Virtual Channel Extension 4 | * 5 | * Copyright 2013 Marc-Andre Moreau 6 | * Copyright 2015 Thincast Technologies GmbH 7 | * Copyright 2015 DI (FH) Martin Haimberger 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #ifndef FREERDP_CHANNEL_SERVER_DRDYNVC_H 23 | #define FREERDP_CHANNEL_SERVER_DRDYNVC_H 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | /** 30 | * Server Interface 31 | */ 32 | 33 | typedef struct _drdynvc_client_context DrdynvcServerContext; 34 | typedef struct _drdynvc_server_private DrdynvcServerPrivate; 35 | 36 | typedef UINT (*psDrdynvcStart)(DrdynvcServerContext* context); 37 | typedef UINT (*psDrdynvcStop)(DrdynvcServerContext* context); 38 | 39 | struct _drdynvc_client_context 40 | { 41 | HANDLE vcm; 42 | 43 | psDrdynvcStart Start; 44 | psDrdynvcStop Stop; 45 | 46 | DrdynvcServerPrivate* priv; 47 | }; 48 | 49 | #ifdef __cplusplus 50 | extern "C" { 51 | #endif 52 | 53 | FREERDP_API DrdynvcServerContext* drdynvc_server_context_new(HANDLE vcm); 54 | FREERDP_API void drdynvc_server_context_free(DrdynvcServerContext* context); 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif /* FREERDP_CHANNEL_SERVER_DRDYNVC_H */ 61 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/server/echo.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Echo Virtual Channel Extension 4 | * 5 | * Copyright 2014 Vic Lee 6 | * Copyright 2015 Thincast Technologies GmbH 7 | * Copyright 2015 DI (FH) Martin Haimberger 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #ifndef FREERDP_CHANNEL_ECHO_SERVER_H 23 | #define FREERDP_CHANNEL_ECHO_SERVER_H 24 | 25 | #include 26 | 27 | typedef enum ECHO_SERVER_OPEN_RESULT 28 | { 29 | ECHO_SERVER_OPEN_RESULT_OK = 0, 30 | ECHO_SERVER_OPEN_RESULT_CLOSED = 1, 31 | ECHO_SERVER_OPEN_RESULT_NOTSUPPORTED = 2, 32 | ECHO_SERVER_OPEN_RESULT_ERROR = 3 33 | } ECHO_SERVER_OPEN_RESULT; 34 | 35 | typedef struct _echo_server_context echo_server_context; 36 | 37 | typedef UINT (*psEchoServerOpen)(echo_server_context* context); 38 | typedef UINT (*psEchoServerClose)(echo_server_context* context); 39 | typedef BOOL (*psEchoServerRequest)(echo_server_context* context, const BYTE* buffer, UINT32 length); 40 | 41 | typedef UINT (*psEchoServerOpenResult)(echo_server_context* context, ECHO_SERVER_OPEN_RESULT result); 42 | typedef UINT (*psEchoServerResponse)(echo_server_context* context, const BYTE* buffer, UINT32 length); 43 | 44 | struct _echo_server_context 45 | { 46 | HANDLE vcm; 47 | 48 | /* Server self-defined pointer. */ 49 | void* data; 50 | 51 | /*** APIs called by the server. ***/ 52 | /** 53 | * Open the echo channel. 54 | */ 55 | psEchoServerOpen Open; 56 | /** 57 | * Close the echo channel. 58 | */ 59 | psEchoServerClose Close; 60 | /** 61 | * Send echo request PDU. 62 | */ 63 | psEchoServerRequest Request; 64 | 65 | /*** Callbacks registered by the server. ***/ 66 | /** 67 | * Indicate whether the channel is opened successfully. 68 | */ 69 | psEchoServerOpenResult OpenResult; 70 | /** 71 | * Receive echo response PDU. 72 | */ 73 | psEchoServerResponse Response; 74 | 75 | rdpContext* rdpcontext; 76 | }; 77 | 78 | #ifdef __cplusplus 79 | extern "C" { 80 | #endif 81 | 82 | FREERDP_API echo_server_context* echo_server_context_new(HANDLE vcm); 83 | FREERDP_API void echo_server_context_free(echo_server_context* context); 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | 89 | #endif /* FREERDP_CHANNEL_ECHO_SERVER_H */ 90 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/server/rdpei.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Extended Input channel server-side definitions 4 | * 5 | * Copyright 2014 Thincast Technologies Gmbh. 6 | * Copyright 2014 David FORT 7 | * Copyright 2015 Thincast Technologies GmbH 8 | * Copyright 2015 DI (FH) Martin Haimberger 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #ifndef __FREERDP_CHANNEL_RDPEI_SERVER_H__ 24 | #define __FREERDP_CHANNEL_RDPEI_SERVER_H__ 25 | 26 | #include 27 | #include 28 | 29 | 30 | typedef struct _rdpei_server_context RdpeiServerContext; 31 | typedef struct _rdpei_server_private RdpeiServerPrivate; 32 | 33 | struct _rdpei_server_context 34 | { 35 | HANDLE vcm; 36 | 37 | RdpeiServerPrivate* priv; 38 | 39 | UINT32 clientVersion; 40 | UINT16 maxTouchPoints; 41 | UINT32 protocolFlags; 42 | 43 | /** callbacks that can be set by the user */ 44 | UINT (*onClientReady)(RdpeiServerContext *context); 45 | UINT (*onTouchEvent)(RdpeiServerContext *context, RDPINPUT_TOUCH_EVENT *touchEvent); 46 | UINT (*onTouchReleased)(RdpeiServerContext *context, BYTE contactId); 47 | 48 | void *user_data; /* user data, useful for callbacks */ 49 | }; 50 | 51 | #ifdef __cplusplus 52 | extern "C" { 53 | #endif 54 | 55 | FREERDP_API RdpeiServerContext* rdpei_server_context_new(HANDLE vcm); 56 | FREERDP_API void rdpei_server_context_reset(RdpeiServerContext *context); 57 | FREERDP_API void rdpei_server_context_free(RdpeiServerContext* context); 58 | FREERDP_API HANDLE rdpei_server_get_event_handle(RdpeiServerContext *context); 59 | FREERDP_API UINT rdpei_server_init(RdpeiServerContext *context); 60 | FREERDP_API UINT rdpei_server_handle_messages(RdpeiServerContext *context); 61 | 62 | FREERDP_API UINT rdpei_server_send_sc_ready(RdpeiServerContext *context, UINT32 version); 63 | FREERDP_API UINT rdpei_server_suspend(RdpeiServerContext *context); 64 | FREERDP_API UINT rdpei_server_resume(RdpeiServerContext *context); 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | 71 | 72 | #endif /* __FREERDP_CHANNEL_RDPEI_SERVER_H__ */ 73 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/server/remdesk.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Remote Assistance Virtual Channel 4 | * 5 | * Copyright 2014 Marc-Andre Moreau 6 | * Copyright 2015 Thincast Technologies GmbH 7 | * Copyright 2015 DI (FH) Martin Haimberger 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #ifndef FREERDP_CHANNEL_SERVER_REMDESK_H 23 | #define FREERDP_CHANNEL_SERVER_REMDESK_H 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | /** 32 | * Server Interface 33 | */ 34 | 35 | typedef struct _remdesk_server_context RemdeskServerContext; 36 | typedef struct _remdesk_server_private RemdeskServerPrivate; 37 | 38 | typedef UINT (*psRemdeskStart)(RemdeskServerContext* context); 39 | typedef UINT (*psRemdeskStop)(RemdeskServerContext* context); 40 | 41 | struct _remdesk_server_context 42 | { 43 | HANDLE vcm; 44 | void* custom; 45 | 46 | psRemdeskStart Start; 47 | psRemdeskStop Stop; 48 | 49 | RemdeskServerPrivate* priv; 50 | rdpContext* rdpcontext; 51 | }; 52 | 53 | #ifdef __cplusplus 54 | extern "C" { 55 | #endif 56 | 57 | FREERDP_API RemdeskServerContext* remdesk_server_context_new(HANDLE vcm); 58 | FREERDP_API void remdesk_server_context_free(RemdeskServerContext* context); 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | 64 | #endif /* FREERDP_CHANNEL_SERVER_REMDESK_H */ 65 | 66 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/session.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Client Session Info 4 | * 5 | * Copyright 2016 David FORT 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | #ifndef __FREERDP_SESSION_H__ 20 | #define __FREERDP_SESSION_H__ 21 | 22 | #include 23 | 24 | /* Logon Information Types */ 25 | #define INFO_TYPE_LOGON 0x00000000 26 | #define INFO_TYPE_LOGON_LONG 0x00000001 27 | #define INFO_TYPE_LOGON_PLAIN_NOTIFY 0x00000002 28 | #define INFO_TYPE_LOGON_EXTENDED_INF 0x00000003 29 | 30 | struct rdp_logon_info { 31 | UINT32 sessionId; 32 | char *username; 33 | char *domain; 34 | }; 35 | typedef struct rdp_logon_info logon_info; 36 | 37 | struct rdp_logon_info_ex { 38 | BOOL haveCookie; 39 | UINT32 LogonId; 40 | BYTE ArcRandomBits[16]; 41 | 42 | BOOL haveErrorInfo; 43 | UINT32 ErrorNotificationType; 44 | UINT32 ErrorNotificationData; 45 | }; 46 | typedef struct rdp_logon_info_ex logon_info_ex; 47 | 48 | #endif /* __FREERDP_SESSION_H__ */ 49 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/svc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Static Virtual Channel Interface 4 | * 5 | * Copyright 2009-2011 Jay Sorg 6 | * Copyright 2015 Thincast Technologies GmbH 7 | * Copyright 2015 DI (FH) Martin Haimberger 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #ifndef FREERDP_SVC_H 23 | #define FREERDP_SVC_H 24 | 25 | #include 26 | #include 27 | 28 | #include 29 | #include 30 | 31 | #define CHANNEL_EVENT_USER 1000 32 | 33 | #define CHANNEL_EXPORT_FUNC_NAME "VirtualChannelEntry" 34 | 35 | #define FREERDP_CHANNEL_MAGIC_NUMBER 0x46524450 36 | 37 | struct _CHANNEL_ENTRY_POINTS_FREERDP 38 | { 39 | UINT32 cbSize; 40 | UINT32 protocolVersion; 41 | PVIRTUALCHANNELINIT pVirtualChannelInit; 42 | PVIRTUALCHANNELOPEN pVirtualChannelOpen; 43 | PVIRTUALCHANNELCLOSE pVirtualChannelClose; 44 | PVIRTUALCHANNELWRITE pVirtualChannelWrite; 45 | 46 | /* Extended Fields */ 47 | UINT32 MagicNumber; /* identifies FreeRDP */ 48 | void* pExtendedData; /* extended initial data */ 49 | void* pInterface; /* channel callback interface, use after initialization */ 50 | void** ppInterface; /* channel callback interface, use for initialization */ 51 | rdpContext* context; 52 | }; 53 | typedef struct _CHANNEL_ENTRY_POINTS_FREERDP CHANNEL_ENTRY_POINTS_FREERDP; 54 | typedef CHANNEL_ENTRY_POINTS_FREERDP* PCHANNEL_ENTRY_POINTS_FREERDP; 55 | 56 | #endif /* FREERDP_SVC_H */ 57 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/types.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Type Definitions 4 | * 5 | * Copyright 2009-2011 Jay Sorg 6 | * Copyright 2011 Marc-Andre Moreau 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef FREERDP_TYPES_H 22 | #define FREERDP_TYPES_H 23 | 24 | #include 25 | #include 26 | 27 | #ifndef MIN 28 | #define MIN(x,y) (((x) < (y)) ? (x) : (y)) 29 | #endif 30 | 31 | #ifndef MAX 32 | #define MAX(x,y) (((x) > (y)) ? (x) : (y)) 33 | #endif 34 | 35 | struct _PALETTE_ENTRY 36 | { 37 | BYTE red; 38 | BYTE green; 39 | BYTE blue; 40 | }; 41 | typedef struct _PALETTE_ENTRY PALETTE_ENTRY; 42 | 43 | struct rdp_palette 44 | { 45 | UINT32 count; 46 | PALETTE_ENTRY entries[256]; 47 | }; 48 | typedef struct rdp_palette rdpPalette; 49 | 50 | #include 51 | 52 | struct _RDP_PLUGIN_DATA 53 | { 54 | DWORD size; 55 | void* data[4]; 56 | }; 57 | typedef struct _RDP_PLUGIN_DATA RDP_PLUGIN_DATA; 58 | 59 | struct _RDP_RECT 60 | { 61 | INT16 x; 62 | INT16 y; 63 | INT16 width; 64 | INT16 height; 65 | }; 66 | typedef struct _RDP_RECT RDP_RECT; 67 | 68 | struct _RECTANGLE_16 69 | { 70 | UINT16 left; 71 | UINT16 top; 72 | UINT16 right; 73 | UINT16 bottom; 74 | }; 75 | typedef struct _RECTANGLE_16 RECTANGLE_16; 76 | 77 | /* Plugin events */ 78 | 79 | #include 80 | #include 81 | 82 | #endif /* __RDP_TYPES_H */ 83 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/utils/passphrase.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Passphrase Handling Utils 4 | * 5 | * Copyright 2011 Shea Levy 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_UTILS_PASSPHRASE_H 21 | #define FREERDP_UTILS_PASSPHRASE_H 22 | 23 | #include 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | FREERDP_API char* freerdp_passphrase_read(const char* prompt, char* buf, size_t bufsiz, int from_stdin); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif /* FREERDP_UTILS_PASSPHRASE_H */ 37 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/utils/pcap.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * pcap File Format Utils 4 | * 5 | * Copyright 2011 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_UTILS_PCAP_H 21 | #define FREERDP_UTILS_PCAP_H 22 | 23 | #include 24 | #include 25 | 26 | struct _pcap_header 27 | { 28 | UINT32 magic_number; /* magic number */ 29 | UINT16 version_major; /* major version number */ 30 | UINT16 version_minor; /* minor version number */ 31 | INT32 thiszone; /* GMT to local correction */ 32 | UINT32 sigfigs; /* accuracy of timestamps */ 33 | UINT32 snaplen; /* max length of captured packets, in octets */ 34 | UINT32 network; /* data link type */ 35 | }; 36 | typedef struct _pcap_header pcap_header; 37 | 38 | struct _pcap_record_header 39 | { 40 | UINT32 ts_sec; /* timestamp seconds */ 41 | UINT32 ts_usec; /* timestamp microseconds */ 42 | UINT32 incl_len; /* number of octets of packet saved in file */ 43 | UINT32 orig_len; /* actual length of packet */ 44 | }; 45 | typedef struct _pcap_record_header pcap_record_header; 46 | 47 | typedef struct _pcap_record pcap_record; 48 | 49 | struct _pcap_record 50 | { 51 | pcap_record_header header; 52 | void* data; 53 | UINT32 length; 54 | pcap_record* next; 55 | }; 56 | 57 | struct rdp_pcap 58 | { 59 | FILE* fp; 60 | char* name; 61 | BOOL write; 62 | int file_size; 63 | int record_count; 64 | pcap_header header; 65 | pcap_record* head; 66 | pcap_record* tail; 67 | pcap_record* record; 68 | }; 69 | typedef struct rdp_pcap rdpPcap; 70 | 71 | #ifdef __cplusplus 72 | extern "C" { 73 | #endif 74 | 75 | FREERDP_API rdpPcap* pcap_open(char* name, BOOL write); 76 | FREERDP_API void pcap_close(rdpPcap* pcap); 77 | 78 | FREERDP_API BOOL pcap_add_record(rdpPcap* pcap, void* data, UINT32 length); 79 | FREERDP_API BOOL pcap_has_next_record(rdpPcap* pcap); 80 | FREERDP_API BOOL pcap_get_next_record(rdpPcap* pcap, pcap_record* record); 81 | FREERDP_API BOOL pcap_get_next_record_header(rdpPcap* pcap, pcap_record* record); 82 | FREERDP_API BOOL pcap_get_next_record_content(rdpPcap* pcap, pcap_record* record); 83 | FREERDP_API void pcap_flush(rdpPcap* pcap); 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | 89 | #endif /* FREERDP_UTILS_PCAP_H */ 90 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/utils/profiler.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Profiler Utils 4 | * 5 | * Copyright 2011 Stephen Erisman 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_UTILS_PROFILER_H 21 | #define FREERDP_UTILS_PROFILER_H 22 | 23 | #include 24 | #include 25 | 26 | struct _PROFILER 27 | { 28 | char* name; 29 | STOPWATCH* stopwatch; 30 | }; 31 | typedef struct _PROFILER PROFILER; 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | FREERDP_API PROFILER* profiler_create(char* name); 38 | FREERDP_API void profiler_free(PROFILER* profiler); 39 | 40 | FREERDP_API void profiler_enter(PROFILER* profiler); 41 | FREERDP_API void profiler_exit(PROFILER* profiler); 42 | 43 | FREERDP_API void profiler_print_header(void); 44 | FREERDP_API void profiler_print(PROFILER* profiler); 45 | FREERDP_API void profiler_print_footer(void); 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #ifdef WITH_PROFILER 52 | #define IF_PROFILER(then) then 53 | #define PROFILER_DEFINE(prof) PROFILER* prof 54 | #define PROFILER_CREATE(prof,name) prof = profiler_create(name) 55 | #define PROFILER_FREE(prof) profiler_free(prof) 56 | #define PROFILER_ENTER(prof) profiler_enter(prof) 57 | #define PROFILER_EXIT(prof) profiler_exit(prof) 58 | #define PROFILER_PRINT_HEADER profiler_print_header() 59 | #define PROFILER_PRINT(prof) profiler_print(prof) 60 | #define PROFILER_PRINT_FOOTER profiler_print_footer() 61 | #else 62 | #define IF_PROFILER(then) do { } while (0) 63 | #define PROFILER_DEFINE(prof) void* prof 64 | #define PROFILER_CREATE(prof,name) do { } while (0) 65 | #define PROFILER_FREE(prof) do { } while (0) 66 | #define PROFILER_ENTER(prof) do { } while (0) 67 | #define PROFILER_EXIT(prof) do { } while (0) 68 | #define PROFILER_PRINT_HEADER do { } while (0) 69 | #define PROFILER_PRINT(prof) do { } while (0) 70 | #define PROFILER_PRINT_FOOTER do { } while (0) 71 | #endif 72 | 73 | #endif /* FREERDP_UTILS_PROFILER_H */ 74 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/utils/signal.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Signal handling 4 | * 5 | * Copyright 2011 Shea Levy 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_UTILS_SIGNAL_H 21 | #define FREERDP_UTILS_SIGNAL_H 22 | 23 | #include 24 | #ifndef _WIN32 25 | #include 26 | #include 27 | 28 | extern volatile sig_atomic_t terminal_needs_reset; 29 | extern int terminal_fildes; 30 | extern struct termios orig_flags; 31 | extern struct termios new_flags; 32 | #endif 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | FREERDP_API int freerdp_handle_signals(void); 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif /* FREERDP_UTILS_SIGNAL_H */ 45 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/utils/stopwatch.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Stopwatch Utils 4 | * 5 | * Copyright 2011 Stephen Erisman 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef FREERDP_UTILS_STOPWATCH_H 21 | #define FREERDP_UTILS_STOPWATCH_H 22 | 23 | #include 24 | #include 25 | 26 | struct _STOPWATCH 27 | { 28 | UINT64 start; 29 | UINT64 end; 30 | UINT64 elapsed; 31 | UINT32 count; 32 | }; 33 | typedef struct _STOPWATCH STOPWATCH; 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | FREERDP_API STOPWATCH* stopwatch_create(void); 40 | FREERDP_API void stopwatch_free(STOPWATCH* stopwatch); 41 | 42 | FREERDP_API void stopwatch_start(STOPWATCH* stopwatch); 43 | FREERDP_API void stopwatch_stop(STOPWATCH* stopwatch); 44 | FREERDP_API void stopwatch_reset(STOPWATCH* stopwatch); 45 | 46 | FREERDP_API double stopwatch_get_elapsed_time_in_seconds(STOPWATCH* stopwatch); 47 | FREERDP_API void stopwatch_get_elapsed_time_in_useconds(STOPWATCH* stopwatch, UINT32* sec, UINT32* usec); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif /* FREERDP_UTILS_STOPWATCH_H */ 54 | -------------------------------------------------------------------------------- /FreeRDP/include/freerdp/version.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Version includes 4 | * 5 | * Copyright 2013 Thincast Technologies GmbH 6 | * Copyright 2013 Bernhard Miklautz 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | #ifndef _FREERDP_VERSION_H_ 21 | #define _FREERDP_VERSION_H_ 22 | 23 | #define FREERDP_VERSION_MAJOR 2 24 | #define FREERDP_VERSION_MINOR 0 25 | #define FREERDP_VERSION_REVISION 0 26 | #define FREERDP_VERSION_SUFFIX "dev" 27 | #define FREERDP_API_VERSION "2" 28 | #define FREERDP_VERSION "2.0.0" 29 | #define FREERDP_VERSION_FULL "2.0.0-dev" 30 | #define GIT_REVISION "b4b8239" 31 | 32 | #endif // _FREERDP_VERSION_H_ 33 | -------------------------------------------------------------------------------- /FreeRDP/include/winpr/clipboard.h: -------------------------------------------------------------------------------- 1 | /** 2 | * WinPR: Windows Portable Runtime 3 | * Clipboard Functions 4 | * 5 | * Copyright 2014 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef WINPR_CLIPBOARD_H 21 | #define WINPR_CLIPBOARD_H 22 | 23 | #include 24 | #include 25 | 26 | typedef struct _wClipboard wClipboard; 27 | 28 | typedef void* (*CLIPBOARD_SYNTHESIZE_FN)(wClipboard* clipboard, UINT32 formatId, const void* data, UINT32* pSize); 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | WINPR_API void ClipboardLock(wClipboard* clipboard); 35 | WINPR_API void ClipboardUnlock(wClipboard* clipboard); 36 | 37 | WINPR_API BOOL ClipboardEmpty(wClipboard* clipboard); 38 | WINPR_API UINT32 ClipboardCountFormats(wClipboard* clipboard); 39 | WINPR_API UINT32 ClipboardGetFormatIds(wClipboard* clipboard, UINT32** ppFormatIds); 40 | 41 | WINPR_API UINT32 ClipboardCountRegisteredFormats(wClipboard* clipboard); 42 | WINPR_API UINT32 ClipboardGetRegisteredFormatIds(wClipboard* clipboard, UINT32** ppFormatIds); 43 | WINPR_API UINT32 ClipboardRegisterFormat(wClipboard* clipboard, const char* name); 44 | 45 | WINPR_API BOOL ClipboardRegisterSynthesizer(wClipboard* clipboard, UINT32 formatId, 46 | UINT32 syntheticId, CLIPBOARD_SYNTHESIZE_FN pfnSynthesize); 47 | 48 | WINPR_API UINT32 ClipboardGetFormatId(wClipboard* clipboard, const char* name); 49 | WINPR_API const char* ClipboardGetFormatName(wClipboard* clipboard, UINT32 formatId); 50 | WINPR_API void* ClipboardGetData(wClipboard* clipboard, UINT32 formatId, UINT32* pSize); 51 | WINPR_API BOOL ClipboardSetData(wClipboard* clipboard, UINT32 formatId, const void* data, UINT32 size); 52 | 53 | WINPR_API UINT64 ClipboardGetOwner(wClipboard* clipboard); 54 | WINPR_API void ClipboardSetOwner(wClipboard* clipboard, UINT64 ownerId); 55 | 56 | WINPR_API wClipboard* ClipboardCreate(); 57 | WINPR_API void ClipboardDestroy(wClipboard* clipboard); 58 | 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | 63 | #endif /* WINPR_CLIPBOARD_H */ 64 | 65 | -------------------------------------------------------------------------------- /FreeRDP/include/winpr/debug.h: -------------------------------------------------------------------------------- 1 | /** 2 | * WinPR: Windows Portable Runtime 3 | * WinPR Debugging helpers 4 | * 5 | * Copyright 2014 Armin Novak 6 | * Copyright 2014 Thincast Technologies GmbH 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef WINPR_DEBUG_H 22 | #define WINPR_DEBUG_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | #include 29 | 30 | WINPR_API void winpr_log_backtrace(const char* tag, DWORD level, DWORD size); 31 | WINPR_API void* winpr_backtrace(DWORD size); 32 | WINPR_API void winpr_backtrace_free(void* buffer); 33 | WINPR_API char** winpr_backtrace_symbols(void* buffer, size_t* used); 34 | WINPR_API void winpr_backtrace_symbols_fd(void* buffer, int fd); 35 | WINPR_API char* winpr_strerror(DWORD dw, char* dmsg, size_t size); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif /* WINPR_WLOG_H */ 42 | 43 | -------------------------------------------------------------------------------- /FreeRDP/include/winpr/handle.h: -------------------------------------------------------------------------------- 1 | /** 2 | * WinPR: Windows Portable Runtime 3 | * Handle Management 4 | * 5 | * Copyright 2012 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef WINPR_HANDLE_H 21 | #define WINPR_HANDLE_H 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | #define WINPR_FD_READ_BIT 0 35 | #define WINPR_FD_READ (1 << WINPR_FD_READ_BIT) 36 | 37 | #define WINPR_FD_WRITE_BIT 1 38 | #define WINPR_FD_WRITE (1 << WINPR_FD_WRITE_BIT) 39 | 40 | #ifndef _WIN32 41 | 42 | #define DUPLICATE_CLOSE_SOURCE 0x00000001 43 | #define DUPLICATE_SAME_ACCESS 0x00000002 44 | 45 | #define HANDLE_FLAG_INHERIT 0x00000001 46 | #define HANDLE_FLAG_PROTECT_FROM_CLOSE 0x00000002 47 | 48 | WINPR_API BOOL CloseHandle(HANDLE hObject); 49 | 50 | WINPR_API BOOL DuplicateHandle(HANDLE hSourceProcessHandle, 51 | HANDLE hSourceHandle, 52 | HANDLE hTargetProcessHandle, 53 | LPHANDLE lpTargetHandle, 54 | DWORD dwDesiredAccess, 55 | BOOL bInheritHandle, DWORD dwOptions); 56 | 57 | WINPR_API BOOL GetHandleInformation(HANDLE hObject, LPDWORD lpdwFlags); 58 | WINPR_API BOOL SetHandleInformation(HANDLE hObject, DWORD dwMask, DWORD dwFlags); 59 | 60 | #endif 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif /* WINPR_HANDLE_H */ 67 | 68 | -------------------------------------------------------------------------------- /FreeRDP/include/winpr/heap.h: -------------------------------------------------------------------------------- 1 | /** 2 | * WinPR: Windows Portable Runtime 3 | * Heap Memory Allocation 4 | * 5 | * Copyright 2012 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef WINPR_HEAP_H 21 | #define WINPR_HEAP_H 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #ifndef _WIN32 30 | 31 | #define HEAP_GENERATE_EXCEPTIONS 0x00000004 32 | #define HEAP_NO_SERIALIZE 0x00000001 33 | #define HEAP_ZERO_MEMORY 0x00000008 34 | #define HEAP_REALLOC_IN_PLACE_ONLY 0x00000010 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | WINPR_API HANDLE GetProcessHeap(void); 41 | WINPR_API LPVOID HeapAlloc(HANDLE hHeap, DWORD dwFlags, SIZE_T dwBytes); 42 | WINPR_API LPVOID HeapReAlloc(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem, SIZE_T dwBytes); 43 | WINPR_API BOOL HeapFree(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem); 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif 50 | 51 | #endif /* WINPR_HEAP_H */ 52 | 53 | -------------------------------------------------------------------------------- /FreeRDP/include/winpr/image.h: -------------------------------------------------------------------------------- 1 | /** 2 | * WinPR: Windows Portable Runtime 3 | * Image Utils 4 | * 5 | * Copyright 2014 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef WINPR_IMAGE_H 21 | #define WINPR_IMAGE_H 22 | 23 | #include 24 | #include 25 | 26 | #pragma pack(push, 1) 27 | 28 | struct _WINPR_BITMAP_FILE_HEADER 29 | { 30 | BYTE bfType[2]; 31 | UINT32 bfSize; 32 | UINT16 bfReserved1; 33 | UINT16 bfReserved2; 34 | UINT32 bfOffBits; 35 | }; 36 | typedef struct _WINPR_BITMAP_FILE_HEADER WINPR_BITMAP_FILE_HEADER; 37 | 38 | struct _WINPR_BITMAP_INFO_HEADER 39 | { 40 | UINT32 biSize; 41 | INT32 biWidth; 42 | INT32 biHeight; 43 | UINT16 biPlanes; 44 | UINT16 biBitCount; 45 | UINT32 biCompression; 46 | UINT32 biSizeImage; 47 | INT32 biXPelsPerMeter; 48 | INT32 biYPelsPerMeter; 49 | UINT32 biClrUsed; 50 | UINT32 biClrImportant; 51 | }; 52 | typedef struct _WINPR_BITMAP_INFO_HEADER WINPR_BITMAP_INFO_HEADER; 53 | 54 | struct _WINPR_BITMAP_CORE_HEADER 55 | { 56 | UINT32 bcSize; 57 | UINT16 bcWidth; 58 | UINT16 bcHeight; 59 | UINT16 bcPlanes; 60 | UINT16 bcBitCount; 61 | }; 62 | typedef struct _WINPR_BITMAP_CORE_HEADER WINPR_BITMAP_CORE_HEADER; 63 | 64 | #pragma pack(pop) 65 | 66 | #define WINPR_IMAGE_BITMAP 0 67 | #define WINPR_IMAGE_PNG 1 68 | 69 | struct _wImage 70 | { 71 | int type; 72 | int width; 73 | int height; 74 | BYTE* data; 75 | int scanline; 76 | int bitsPerPixel; 77 | int bytesPerPixel; 78 | }; 79 | typedef struct _wImage wImage; 80 | 81 | #ifdef __cplusplus 82 | extern "C" { 83 | #endif 84 | 85 | WINPR_API int winpr_bitmap_write(const char* filename, BYTE* data, int width, int height, int bpp); 86 | 87 | WINPR_API int winpr_image_write(wImage* image, const char* filename); 88 | WINPR_API int winpr_image_read(wImage* image, const char* filename); 89 | 90 | WINPR_API int winpr_image_read_buffer(wImage* image, BYTE* buffer, int size); 91 | 92 | WINPR_API wImage* winpr_image_new(); 93 | WINPR_API void winpr_image_free(wImage* image, BOOL bFreeBuffer); 94 | 95 | #ifdef __cplusplus 96 | } 97 | #endif 98 | 99 | #endif /* WINPR_IMAGE_H */ 100 | -------------------------------------------------------------------------------- /FreeRDP/include/winpr/ini.h: -------------------------------------------------------------------------------- 1 | /** 2 | * WinPR: Windows Portable Runtime 3 | * .ini config file 4 | * 5 | * Copyright 2014 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef WINPR_UTILS_INI_H 21 | #define WINPR_UTILS_INI_H 22 | 23 | #include 24 | #include 25 | 26 | struct _wIniFileKey 27 | { 28 | char* name; 29 | char* value; 30 | }; 31 | typedef struct _wIniFileKey wIniFileKey; 32 | 33 | struct _wIniFileSection 34 | { 35 | char* name; 36 | int nKeys; 37 | int cKeys; 38 | wIniFileKey** keys; 39 | }; 40 | typedef struct _wIniFileSection wIniFileSection; 41 | 42 | struct _wIniFile 43 | { 44 | FILE* fp; 45 | char* line; 46 | char* nextLine; 47 | int lineLength; 48 | char* buffer; 49 | char* filename; 50 | BOOL readOnly; 51 | int nSections; 52 | int cSections; 53 | wIniFileSection** sections; 54 | }; 55 | typedef struct _wIniFile wIniFile; 56 | 57 | #ifdef __cplusplus 58 | extern "C" { 59 | #endif 60 | 61 | WINPR_API int IniFile_ReadBuffer(wIniFile* ini, const char* buffer); 62 | WINPR_API int IniFile_ReadFile(wIniFile* ini, const char* filename); 63 | 64 | WINPR_API char* IniFile_WriteBuffer(wIniFile* ini); 65 | WINPR_API int IniFile_WriteFile(wIniFile* ini, const char* filename); 66 | 67 | WINPR_API char** IniFile_GetSectionNames(wIniFile* ini, int* count); 68 | WINPR_API char** IniFile_GetSectionKeyNames(wIniFile* ini, const char* section, int* count); 69 | 70 | WINPR_API const char* IniFile_GetKeyValueString(wIniFile* ini, const char* section, const char* key); 71 | WINPR_API int IniFile_GetKeyValueInt(wIniFile* ini, const char* section, const char* key); 72 | 73 | WINPR_API int IniFile_SetKeyValueString(wIniFile* ini, const char* section, const char* key, const char* value); 74 | WINPR_API int IniFile_SetKeyValueInt(wIniFile* ini, const char* section, const char* key, int value); 75 | 76 | WINPR_API wIniFile* IniFile_New(); 77 | WINPR_API void IniFile_Free(wIniFile* ini); 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | 83 | #endif /* WINPR_UTILS_INI_H */ 84 | 85 | -------------------------------------------------------------------------------- /FreeRDP/include/winpr/intrin.h: -------------------------------------------------------------------------------- 1 | /** 2 | * WinPR: Windows Portable Runtime 3 | * C Run-Time Library Routines 4 | * 5 | * Copyright 2015 Thincast Technologies GmbH 6 | * Copyright 2015 Bernhard Miklautz 7 | * 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #ifndef WINPR_INTRIN_H 23 | #define WINPR_INTRIN_H 24 | 25 | #ifndef _WIN32 26 | 27 | /** 28 | * __lzcnt16, __lzcnt, __lzcnt64: 29 | * http://msdn.microsoft.com/en-us/library/bb384809/ 30 | * 31 | * Beware: the result of __builtin_clz(0) is undefined 32 | */ 33 | 34 | #if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) 35 | 36 | static INLINE UINT32 __lzcnt(UINT32 _val32) { 37 | return ((UINT32) __builtin_clz(_val32)); 38 | } 39 | 40 | static INLINE UINT16 __lzcnt16(UINT16 _val16) { 41 | return ((UINT16) (__builtin_clz((UINT32) _val16) - 16)); 42 | } 43 | 44 | #else /* (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2) */ 45 | 46 | static INLINE UINT32 __lzcnt(UINT32 x) 47 | { 48 | unsigned y; 49 | int n = 32; 50 | y = x >> 16; if (y != 0) { n = n - 16; x = y; } 51 | y = x >> 8; if (y != 0) { n = n - 8; x = y; } 52 | y = x >> 4; if (y != 0) { n = n - 4; x = y; } 53 | y = x >> 2; if (y != 0) { n = n - 2; x = y; } 54 | y = x >> 1; if (y != 0) return n - 2; 55 | return n - x; 56 | } 57 | 58 | static INLINE UINT16 __lzcnt16(UINT16 x) 59 | { 60 | return ((UINT16) __lzcnt((UINT32) x)); 61 | } 62 | 63 | #endif /* (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2) */ 64 | 65 | #endif /* _WIN32 */ 66 | #endif /* WINPR_INTRIN_H */ 67 | -------------------------------------------------------------------------------- /FreeRDP/include/winpr/library.h: -------------------------------------------------------------------------------- 1 | /** 2 | * WinPR: Windows Portable Runtime 3 | * Library Loader 4 | * 5 | * Copyright 2012 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef WINPR_LIBRARY_H 21 | #define WINPR_LIBRARY_H 22 | 23 | #include 24 | #include 25 | 26 | #ifndef _WIN32 27 | 28 | typedef HANDLE DLL_DIRECTORY_COOKIE; 29 | 30 | #define LOAD_LIBRARY_SEARCH_APPLICATION_DIR 0x00000200 31 | #define LOAD_LIBRARY_SEARCH_DEFAULT_DIRS 0x00001000 32 | #define LOAD_LIBRARY_SEARCH_SYSTEM32 0x00000800 33 | #define LOAD_LIBRARY_SEARCH_USER_DIRS 0x00000400 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | WINPR_API DLL_DIRECTORY_COOKIE AddDllDirectory(PCWSTR NewDirectory); 40 | WINPR_API BOOL RemoveDllDirectory(DLL_DIRECTORY_COOKIE Cookie); 41 | WINPR_API BOOL SetDefaultDllDirectories(DWORD DirectoryFlags); 42 | 43 | WINPR_API HMODULE LoadLibraryA(LPCSTR lpLibFileName); 44 | WINPR_API HMODULE LoadLibraryW(LPCWSTR lpLibFileName); 45 | 46 | WINPR_API HMODULE LoadLibraryExA(LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags); 47 | WINPR_API HMODULE LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags); 48 | 49 | WINPR_API HMODULE GetModuleHandleA(LPCSTR lpModuleName); 50 | WINPR_API HMODULE GetModuleHandleW(LPCWSTR lpModuleName); 51 | 52 | WINPR_API DWORD GetModuleFileNameA(HMODULE hModule, LPSTR lpFilename, DWORD nSize); 53 | WINPR_API DWORD GetModuleFileNameW(HMODULE hModule, LPWSTR lpFilename, DWORD nSize); 54 | 55 | #ifdef UNICODE 56 | #define LoadLibrary LoadLibraryW 57 | #define LoadLibraryEx LoadLibraryExW 58 | #define GetModuleHandle GetModuleHandleW 59 | #define GetModuleFileName GetModuleFileNameW 60 | #else 61 | #define LoadLibrary LoadLibraryA 62 | #define LoadLibraryEx LoadLibraryExA 63 | #define GetModuleHandle GetModuleHandleA 64 | #define GetModuleFileName GetModuleFileNameA 65 | #endif 66 | 67 | WINPR_API FARPROC GetProcAddress(HMODULE hModule, LPCSTR lpProcName); 68 | 69 | WINPR_API BOOL FreeLibrary(HMODULE hLibModule); 70 | 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | 75 | #endif 76 | 77 | #endif /* WINPR_LIBRARY_H */ 78 | 79 | -------------------------------------------------------------------------------- /FreeRDP/include/winpr/memory.h: -------------------------------------------------------------------------------- 1 | /** 2 | * WinPR: Windows Portable Runtime 3 | * Memory Allocation 4 | * 5 | * Copyright 2012 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef WINPR_MEMORY_H 21 | #define WINPR_MEMORY_H 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | #include 29 | 30 | #include 31 | #include 32 | #include 33 | 34 | #ifndef _WIN32 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | WINPR_API HANDLE CreateFileMappingA(HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes, DWORD flProtect, 41 | DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, LPCSTR lpName); 42 | WINPR_API HANDLE CreateFileMappingW(HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes, DWORD flProtect, 43 | DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, LPCWSTR lpName); 44 | 45 | WINPR_API HANDLE OpenFileMappingA(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName); 46 | WINPR_API HANDLE OpenFileMappingW(DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName); 47 | 48 | WINPR_API LPVOID MapViewOfFile(HANDLE hFileMappingObject, DWORD dwDesiredAccess, DWORD dwFileOffsetHigh, 49 | DWORD dwFileOffsetLow, SIZE_T dwNumberOfBytesToMap); 50 | 51 | WINPR_API LPVOID MapViewOfFileEx(HANDLE hFileMappingObject, DWORD dwDesiredAccess, DWORD dwFileOffsetHigh, 52 | DWORD dwFileOffsetLow, SIZE_T dwNumberOfBytesToMap, LPVOID lpBaseAddress); 53 | 54 | WINPR_API BOOL FlushViewOfFile(LPCVOID lpBaseAddress, SIZE_T dwNumberOfBytesToFlush); 55 | 56 | WINPR_API BOOL UnmapViewOfFile(LPCVOID lpBaseAddress); 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #ifdef UNICODE 63 | #define CreateFileMapping CreateFileMappingW 64 | #define OpenFileMapping OpenFileMappingW 65 | #else 66 | #define CreateFileMapping CreateFileMappingA 67 | #define OpenFileMapping OpenFileMappingA 68 | #endif 69 | 70 | #endif 71 | 72 | #endif /* WINPR_MEMORY_H */ 73 | 74 | -------------------------------------------------------------------------------- /FreeRDP/include/winpr/midl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * WinPR: Windows Portable Runtime 3 | * Microsoft Remote Procedure Call (MSRPC) 4 | * 5 | * Copyright 2012 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef WINPR_RPC_MIDL_H 21 | #define WINPR_RPC_MIDL_H 22 | 23 | #include 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #ifndef _WIN32 30 | 31 | WINPR_API void* MIDL_user_allocate(size_t cBytes); 32 | WINPR_API void MIDL_user_free(void* p); 33 | 34 | #endif 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | #endif /* WINPR_RPC_MIDL_H */ 41 | -------------------------------------------------------------------------------- /FreeRDP/include/winpr/ntlm.h: -------------------------------------------------------------------------------- 1 | /** 2 | * WinPR: Windows Portable Runtime 3 | * NTLM Utils 4 | * 5 | * Copyright 2012 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef WINPR_UTILS_NTLM_H 21 | #define WINPR_UTILS_NTLM_H 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | WINPR_API BYTE* NTOWFv1W(LPWSTR Password, UINT32 PasswordLength, BYTE* NtHash); 34 | WINPR_API BYTE* NTOWFv1A(LPSTR Password, UINT32 PasswordLength, BYTE* NtHash); 35 | 36 | WINPR_API BYTE* NTOWFv2W(LPWSTR Password, UINT32 PasswordLength, LPWSTR User, 37 | UINT32 UserLength, LPWSTR Domain, UINT32 DomainLength, BYTE* NtHash); 38 | WINPR_API BYTE* NTOWFv2A(LPSTR Password, UINT32 PasswordLength, LPSTR User, 39 | UINT32 UserLength, LPSTR Domain, UINT32 DomainLength, BYTE* NtHash); 40 | 41 | WINPR_API BYTE* NTOWFv2FromHashW(BYTE* NtHashV1, LPWSTR User, UINT32 UserLength, 42 | LPWSTR Domain, UINT32 DomainLength, BYTE* NtHash); 43 | WINPR_API BYTE* NTOWFv2FromHashA(BYTE* NtHashV1, LPSTR User, UINT32 UserLength, 44 | LPSTR Domain, UINT32 DomainLength, BYTE* NtHash); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #ifdef UNICODE 51 | #define NTOWFv1 NTOWFv1W 52 | #define NTOWFv2 NTOWFv2W 53 | #define NTOWFv2FromHash NTOWFv2FromHashW 54 | #else 55 | #define NTOWFv1 NTOWFv1A 56 | #define NTOWFv2 NTOWFv2A 57 | #define NTOWFv2FromHash NTOWFv2FromHashA 58 | #endif 59 | 60 | #endif /* WINPR_UTILS_NTLM_H */ 61 | 62 | -------------------------------------------------------------------------------- /FreeRDP/include/winpr/pack.h: -------------------------------------------------------------------------------- 1 | /** 2 | * WinPR: Windows Portable Runtime 3 | * Pragma Pack 4 | * 5 | * Copyright 2014 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | /** 21 | * This header is meant to be repeatedly included 22 | * after defining the operation to be done: 23 | * 24 | * #define WINPR_PACK_PUSH 25 | * #include // enables packing 26 | * 27 | * #define WINPR_PACK_POP 28 | * #include // disables packing 29 | * 30 | * On each include, WINPR_PACK_* macros are undefined. 31 | */ 32 | 33 | #if !defined(__APPLE__) 34 | #ifndef WINPR_PRAGMA_PACK_EXT 35 | #define WINPR_PRAGMA_PACK_EXT 36 | #endif 37 | #endif 38 | 39 | #ifdef PRAGMA_PACK_PUSH 40 | #ifndef PRAGMA_PACK_PUSH1 41 | #define PRAGMA_PACK_PUSH1 42 | #endif 43 | #undef PRAGMA_PACK_PUSH 44 | #endif 45 | 46 | #ifdef PRAGMA_PACK_PUSH1 47 | #ifdef WINPR_PRAGMA_PACK_EXT 48 | #pragma pack(push, 1) 49 | #else 50 | #pragma pack(1) 51 | #endif 52 | #undef PRAGMA_PACK_PUSH1 53 | #endif 54 | 55 | #ifdef PRAGMA_PACK_PUSH2 56 | #ifdef WINPR_PRAGMA_PACK_EXT 57 | #pragma pack(push, 2) 58 | #else 59 | #pragma pack(2) 60 | #endif 61 | #undef PRAGMA_PACK_PUSH2 62 | #endif 63 | 64 | #ifdef PRAGMA_PACK_PUSH4 65 | #ifdef WINPR_PRAGMA_PACK_EXT 66 | #pragma pack(push, 4) 67 | #else 68 | #pragma pack(4) 69 | #endif 70 | #undef PRAGMA_PACK_PUSH4 71 | #endif 72 | 73 | #ifdef PRAGMA_PACK_PUSH8 74 | #ifdef WINPR_PRAGMA_PACK_EXT 75 | #pragma pack(push, 8) 76 | #else 77 | #pragma pack(8) 78 | #endif 79 | #undef PRAGMA_PACK_PUSH8 80 | #endif 81 | 82 | #ifdef PRAGMA_PACK_PUSH16 83 | #ifdef WINPR_PRAGMA_PACK_EXT 84 | #pragma pack(push, 16) 85 | #else 86 | #pragma pack(16) 87 | #endif 88 | #undef PRAGMA_PACK_PUSH16 89 | #endif 90 | 91 | #ifdef PRAGMA_PACK_POP 92 | #ifdef WINPR_PRAGMA_PACK_EXT 93 | #pragma pack(pop) 94 | #else 95 | #pragma pack() 96 | #endif 97 | #undef PRAGMA_PACK_POP 98 | #endif 99 | 100 | #undef WINPR_PRAGMA_PACK_EXT 101 | 102 | -------------------------------------------------------------------------------- /FreeRDP/include/winpr/print.h: -------------------------------------------------------------------------------- 1 | /** 2 | * WinPR: Windows Portable Runtime 3 | * Print Utils 4 | * 5 | * Copyright 2012 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef WINPR_UTILS_PRINT_H 21 | #define WINPR_UTILS_PRINT_H 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | #include 29 | 30 | #define WINPR_HEXDUMP_LINE_LENGTH 16 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | WINPR_API void winpr_HexDump(const char* tag, int lvl, const BYTE* data, int length); 37 | WINPR_API void winpr_CArrayDump(const char* tag, int lvl, const BYTE* data, int length, int width); 38 | 39 | WINPR_API char* winpr_BinToHexString(const BYTE* data, int length, BOOL space); 40 | 41 | WINPR_API int wprintfx(const char* fmt, ...); 42 | WINPR_API int wvprintfx(const char* fmt, va_list args); 43 | WINPR_API int wvsnprintfx(char* buffer, size_t bufferSize, const char* fmt, va_list args); 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif /* WINPR_UTILS_PRINT_H */ 50 | -------------------------------------------------------------------------------- /FreeRDP/include/winpr/sam.h: -------------------------------------------------------------------------------- 1 | /** 2 | * WinPR: Windows Portable Runtime 3 | * Security Accounts Manager (SAM) 4 | * 5 | * Copyright 2012 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef WINPR_UTILS_SAM_H 21 | #define WINPR_UTILS_SAM_H 22 | 23 | #include 24 | #include 25 | 26 | struct winpr_sam 27 | { 28 | FILE* fp; 29 | char* line; 30 | char* buffer; 31 | BOOL read_only; 32 | }; 33 | typedef struct winpr_sam WINPR_SAM; 34 | 35 | struct winpr_sam_entry 36 | { 37 | LPSTR User; 38 | UINT32 UserLength; 39 | LPSTR Domain; 40 | UINT32 DomainLength; 41 | BYTE LmHash[16]; 42 | BYTE NtHash[16]; 43 | }; 44 | typedef struct winpr_sam_entry WINPR_SAM_ENTRY; 45 | 46 | #ifdef __cplusplus 47 | extern "C" { 48 | #endif 49 | 50 | WINPR_API WINPR_SAM_ENTRY* SamLookupUserA(WINPR_SAM* sam, LPSTR User, UINT32 UserLength, LPSTR Domain, UINT32 DomainLength); 51 | WINPR_API WINPR_SAM_ENTRY* SamLookupUserW(WINPR_SAM* sam, LPWSTR User, UINT32 UserLength, LPWSTR Domain, UINT32 DomainLength); 52 | 53 | WINPR_API void SamResetEntry(WINPR_SAM_ENTRY* entry); 54 | WINPR_API void SamFreeEntry(WINPR_SAM* sam, WINPR_SAM_ENTRY* entry); 55 | 56 | WINPR_API WINPR_SAM* SamOpen(BOOL read_only); 57 | WINPR_API void SamClose(WINPR_SAM* sam); 58 | 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | 63 | #endif /* WINPR_UTILS_SAM_H */ 64 | 65 | -------------------------------------------------------------------------------- /FreeRDP/include/winpr/shell.h: -------------------------------------------------------------------------------- 1 | /** 2 | * WinPR: Windows Portable Runtime 3 | * Shell Functions 4 | * 5 | * Copyright 2015 Dell Software 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef WINPR_SHELL_H 21 | #define WINPR_SHELL_H 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #ifndef _WIN32 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | WINPR_API BOOL GetUserProfileDirectoryA(HANDLE hToken, LPSTR lpProfileDir, LPDWORD lpcchSize); 36 | 37 | WINPR_API BOOL GetUserProfileDirectoryW(HANDLE hToken, LPWSTR lpProfileDir, LPDWORD lpcchSize); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #ifdef UNICODE 44 | #define GetUserProfileDirectory GetUserProfileDirectoryW 45 | #else 46 | #define GetUserProfileDirectory GetUserProfileDirectoryA 47 | #endif 48 | 49 | #endif 50 | 51 | #endif /* WINPR_SHELL_H */ 52 | 53 | -------------------------------------------------------------------------------- /FreeRDP/include/winpr/ssl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * WinPR: Windows Portable Runtime 3 | * OpenSSL Library Initialization 4 | * 5 | * Copyright 2014 Thincast Technologies GmbH 6 | * Copyright 2014 Norbert Federa 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef WINPR_SSL_H 22 | #define WINPR_SSL_H 23 | 24 | #include 25 | 26 | #define WINPR_SSL_INIT_DEFAULT 0x00 27 | #define WINPR_SSL_INIT_ALREADY_INITIALIZED 0x01 28 | #define WINPR_SSL_INIT_ENABLE_LOCKING 0x2 29 | 30 | #define WINPR_SSL_CLEANUP_GLOBAL 0x01 31 | #define WINPR_SSL_CLEANUP_THREAD 0x02 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | WINPR_API BOOL winpr_InitializeSSL(DWORD flags); 38 | WINPR_API BOOL winpr_CleanupSSL(DWORD flags); 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif /* WINPR_SSL_H */ 45 | 46 | -------------------------------------------------------------------------------- /FreeRDP/include/winpr/tchar.h: -------------------------------------------------------------------------------- 1 | /** 2 | * WinPR: Windows Portable Runtime 3 | * TCHAR 4 | * 5 | * Copyright 2012 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef WINPR_TCHAR_H 21 | #define WINPR_TCHAR_H 22 | 23 | #include 24 | #include 25 | 26 | #ifdef _WIN32 27 | 28 | #include 29 | 30 | #else 31 | 32 | #ifdef UNICODE 33 | typedef WCHAR TCHAR; 34 | #else 35 | typedef CHAR TCHAR; 36 | #endif 37 | 38 | #ifdef UNICODE 39 | #define _tprintf wprintf 40 | #define _tcslen _wcslen 41 | #define _tcsdup _wcsdup 42 | #define _tcscmp wcscmp 43 | #define _tcsncmp wcsncmp 44 | #define _tcscpy wcscpy 45 | #define _tcscat wcscat 46 | #define _tcschr wcschr 47 | #define _tcsrchr wcsrchr 48 | #define _tcsstr wcsstr 49 | #define _stprintf_s swprintf_s 50 | #else 51 | #define _tprintf printf 52 | #define _tcslen strlen 53 | #define _tcsdup _strdup 54 | #define _tcscmp strcmp 55 | #define _tcsncmp strncmp 56 | #define _tcscpy strcpy 57 | #define _tcscat strcat 58 | #define _tcschr strchr 59 | #define _tcsrchr strrchr 60 | #define _tcsstr strstr 61 | #define _stprintf_s sprintf_s 62 | #endif 63 | 64 | #endif 65 | 66 | #endif /* WINPR_TCHAR_H */ 67 | -------------------------------------------------------------------------------- /FreeRDP/include/winpr/tools/makecert.h: -------------------------------------------------------------------------------- 1 | /** 2 | * WinPR: Windows Portable Runtime 3 | * makecert replacement 4 | * 5 | * Copyright 2012 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef MAKECERT_TOOL_H 21 | #define MAKECERT_TOOL_H 22 | 23 | #include 24 | #include 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | typedef struct _MAKECERT_CONTEXT MAKECERT_CONTEXT; 30 | 31 | WINPR_API int makecert_context_process(MAKECERT_CONTEXT* context, int argc, char** argv); 32 | 33 | WINPR_API int makecert_context_set_output_file_name(MAKECERT_CONTEXT* context, char* name); 34 | WINPR_API int makecert_context_output_certificate_file(MAKECERT_CONTEXT* context, char* path); 35 | WINPR_API int makecert_context_output_private_key_file(MAKECERT_CONTEXT* context, char* path); 36 | 37 | WINPR_API MAKECERT_CONTEXT* makecert_context_new(); 38 | WINPR_API void makecert_context_free(MAKECERT_CONTEXT* context); 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif /* MAKECERT_TOOL_H */ 45 | -------------------------------------------------------------------------------- /FreeRDP/include/winpr/version.h: -------------------------------------------------------------------------------- 1 | /** 2 | * FreeRDP: A Remote Desktop Protocol Implementation 3 | * Version includes 4 | * 5 | * Copyright 2013 Thincast Technologies GmbH 6 | * Copyright 2013 Bernhard Miklautz 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | #ifndef _WINPR_VERSION_H_ 21 | #define _WINPR_VERSION_H_ 22 | 23 | #define WINPR_VERSION_MAJOR 1 24 | #define WINPR_VERSION_MINOR 2 25 | #define WINPR_VERSION_REVISION 0 26 | #define WINPR_VERSION_SUFFIX "" 27 | #define WINPR_API_VERSION "1" 28 | #define WINPR_VERSION "1.2.0" 29 | #define WINPR_VERSION_FULL "1.2.0" 30 | #define GIT_REVISION "b4b8239" 31 | 32 | #endif // _WINPR_VERSION_H_ 33 | -------------------------------------------------------------------------------- /FreeRDP/include/winpr/windows.h: -------------------------------------------------------------------------------- 1 | /** 2 | * WinPR: Windows Portable Runtime 3 | * Windows Header Include Wrapper 4 | * 5 | * Copyright 2012 Marc-Andre Moreau 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef WINPR_WINDOWS_H 21 | #define WINPR_WINDOWS_H 22 | 23 | /* Windows header include order is important, use this instead of including windows.h directly */ 24 | 25 | #ifdef _WIN32 26 | 27 | #ifndef WIN32_LEAN_AND_MEAN 28 | #define WIN32_LEAN_AND_MEAN 29 | #endif 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | #endif 36 | 37 | #endif /* WINPR_WINDOWS_H */ 38 | -------------------------------------------------------------------------------- /FreeRDP/include/winpr/winpr.h: -------------------------------------------------------------------------------- 1 | /** 2 | * WinPR: Windows Portable Runtime 3 | * 4 | * Copyright 2012 Marc-Andre Moreau 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #ifndef WINPR_H 20 | #define WINPR_H 21 | 22 | #if defined _WIN32 || defined __CYGWIN__ 23 | #ifdef WINPR_EXPORTS 24 | #ifdef __GNUC__ 25 | #define WINPR_API __attribute__((dllexport)) 26 | #else 27 | #define WINPR_API __declspec(dllexport) 28 | #endif 29 | #else 30 | #ifdef __GNUC__ 31 | #define WINPR_API __attribute__((dllimport)) 32 | #else 33 | #define WINPR_API __declspec(dllimport) 34 | #endif 35 | #endif 36 | #else 37 | #if __GNUC__ >= 4 38 | #define WINPR_API __attribute__ ((visibility("default"))) 39 | #else 40 | #define WINPR_API 41 | #endif 42 | #endif 43 | 44 | #ifdef _WIN32 45 | #define INLINE __inline 46 | #else 47 | #define INLINE inline 48 | #endif 49 | 50 | WINPR_API void winpr_get_version(int* major, int* minor, int* revision); 51 | WINPR_API const char* winpr_get_version_string(void); 52 | WINPR_API const char* winpr_get_build_date(void); 53 | WINPR_API const char* winpr_get_build_revision(void); 54 | WINPR_API const char* winpr_get_build_config(void); 55 | 56 | #endif /* WINPR_H */ 57 | -------------------------------------------------------------------------------- /FreeRDP/lib/libfreerdp-client.so: -------------------------------------------------------------------------------- 1 | libfreerdp-client.so.2 -------------------------------------------------------------------------------- /FreeRDP/lib/libfreerdp-client.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonewbee/webRDP/3cde428b49ceefe9351b694797ca213cde968299/FreeRDP/lib/libfreerdp-client.so.2 -------------------------------------------------------------------------------- /FreeRDP/lib/libfreerdp.so: -------------------------------------------------------------------------------- 1 | libfreerdp.so.2 -------------------------------------------------------------------------------- /FreeRDP/lib/libfreerdp.so.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonewbee/webRDP/3cde428b49ceefe9351b694797ca213cde968299/FreeRDP/lib/libfreerdp.so.2 -------------------------------------------------------------------------------- /FreeRDP/lib/libwinpr.so: -------------------------------------------------------------------------------- 1 | libwinpr.so.1 -------------------------------------------------------------------------------- /FreeRDP/lib/libwinpr.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gonewbee/webRDP/3cde428b49ceefe9351b694797ca213cde968299/FreeRDP/lib/libwinpr.so.1 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | + Use FreeRDP master branch. 2 | + Go 1.5.1 3 | 4 | ### build 5 | + Need golang.org/x/net/websocket 6 | + FreeRDP dynamic library 7 | There is a example in build.sh 8 | 9 | ### Run 10 | 11 | $./webRDP 12 | 13 | Enter localhost:8080 in web browser. 14 | 15 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | # # go build -ldflags "-r=/home/zsy/Workspace/code/ubuntu14/FreeRDP/libfreerdp" -v main.go 2 | # export FREERDP_PATH=/home/zsy/Workspace/code/FreeRDP 3 | # # export FREERDP_PATH=/workspace/FreeRDP 4 | # export CGO_CFLAGS="-I$FREERDP_PATH/include -I$FREERDP_PATH/winpr/include" 5 | # export CGO_LDFLAGS="-L$FREERDP_PATH/libfreerdp -lfreerdp -L$FREERDP_PATH/client/common -lfreerdp-client -L$FREERDP_PATH/winpr/libwinpr -lwinpr" 6 | # go build -ldflags "-r=$FREERDP_PATH/libfreerdp:$FREERDP_PATH/client/common:$FREERDP_PATH/winpr/libwinpr" -v . 7 | 8 | export FREERDP_PATH=`pwd`/FreeRDP 9 | export CGO_CFLAGS="-I$FREERDP_PATH/include" 10 | export CGO_LDFLAGS="-L$FREERDP_PATH/lib -lfreerdp -lfreerdp-client -lwinpr" 11 | go build -ldflags "-r=$FREERDP_PATH/lib" -v . 12 | 13 | -------------------------------------------------------------------------------- /rdp_event.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | /* 4 | #include "freerdp/freerdp.h" 5 | 6 | static void webrdp_button_press(freerdp* instance, UINT16 flags, int x, int y) { 7 | rdpInput* input; 8 | input = instance->input; 9 | input->MouseEvent(input, flags, x, y); 10 | } 11 | */ 12 | import "C" 13 | import ( 14 | "log" 15 | ) 16 | 17 | func ProcessRDPEvent(instance *C.freerdp, info wsReadInfo) { 18 | switch info.Type { 19 | case "btnPre": 20 | var flags C.UINT16 21 | switch info.Button { 22 | case 0: 23 | // left 24 | flags = C.PTR_FLAGS_DOWN | C.PTR_FLAGS_BUTTON1 25 | case 1: 26 | // middle 27 | flags = C.PTR_FLAGS_DOWN | C.PTR_FLAGS_BUTTON3 28 | case 2: 29 | // right 30 | flags = C.PTR_FLAGS_DOWN | C.PTR_FLAGS_BUTTON2 31 | } 32 | log.Printf("ProcessRDPEvent x:%d y:%d", info.X, info.Y) 33 | C.webrdp_button_press(instance, flags, C.int(info.X), C.int(info.Y)) 34 | case "btnRel": 35 | var flags C.UINT16 36 | switch info.Button { 37 | case 0: 38 | // left 39 | flags = C.PTR_FLAGS_BUTTON1 40 | case 1: 41 | // middle 42 | flags = C.PTR_FLAGS_BUTTON3 43 | case 2: 44 | // right 45 | flags = C.PTR_FLAGS_BUTTON2 46 | } 47 | log.Printf("ProcessRDPEvent x:%d y:%d", info.X, info.Y) 48 | C.webrdp_button_press(instance, flags, C.int(info.X), C.int(info.Y)) 49 | case "mouseMove": 50 | var flags C.UINT16 = C.PTR_FLAGS_MOVE 51 | log.Printf("ProcessRDPEvent x:%d y:%d", info.X, info.Y) 52 | C.webrdp_button_press(instance, flags, C.int(info.X), C.int(info.Y)) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /rdprw.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | /* 4 | #include "webrdp.h" 5 | 6 | static webContext* convert2webContextC(rdpContext* context) { 7 | webContext* xfc = (webContext*) context; 8 | return xfc; 9 | } 10 | 11 | static INT64 getWSChan(rdpContext* context) { 12 | webContext* xfc = (webContext*) context; 13 | return xfc->chanid; 14 | } 15 | */ 16 | import "C" 17 | import ( 18 | "encoding/binary" 19 | "log" 20 | "time" 21 | ) 22 | 23 | func convert2webContext(context *C.rdpContext) *C.webContext { 24 | return C.convert2webContextC(context) 25 | } 26 | 27 | func writeByChen(context *C.rdpContext, info RdpDrawInfo) { 28 | log.Println("writeByChen try to send---------------") 29 | wschan := chans[int64(C.getWSChan(context))] 30 | log.Println(wschan) 31 | if nil == wschan { 32 | xfc := convert2webContext(context) 33 | xfc.disconnect = true 34 | return 35 | } 36 | data := make([]byte, 17) 37 | data[0] = info.Type 38 | binary.BigEndian.PutUint16(data[1:], info.Left) 39 | binary.BigEndian.PutUint16(data[3:], info.Top) 40 | binary.BigEndian.PutUint16(data[5:], info.Width) 41 | binary.BigEndian.PutUint16(data[7:], info.Height) 42 | binary.BigEndian.PutUint32(data[9:], info.Color) 43 | log.Printf("%x %x %x %x", data[9], data[10], data[11], data[12]) 44 | if info.ImgLen != 0 { 45 | binary.BigEndian.PutUint32(data[13:], info.ImgLen) 46 | data = append(data, info.Img...) 47 | log.Println(cap(data)) 48 | } 49 | select { 50 | case wschan <- data: 51 | log.Println("send ok") 52 | case <-time.After(time.Second * 3): 53 | log.Println("send time out") 54 | xfc := convert2webContext(context) 55 | xfc.disconnect = true 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /webrdp.h: -------------------------------------------------------------------------------- 1 | #ifndef _WEB_RDP_H 2 | #define _WEB_RDP_H 3 | 4 | #include "freerdp/freerdp.h" 5 | #include "freerdp/client.h" 6 | 7 | typedef struct { 8 | rdpContext context; 9 | HCLRCONV clrconv; 10 | INT64 chanid; 11 | UINT32 palette[256]; 12 | BOOL disconnect; 13 | } webContext; 14 | 15 | typedef struct web_rdp_bitmap { 16 | rdpBitmap bitmap; 17 | } web_rdp_bitmap; 18 | 19 | #endif --------------------------------------------------------------------------------