commit
5384e241f1
@ -0,0 +1,32 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2014
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* planar bitmap compressor
|
||||
* 32 bpp compression
|
||||
*/
|
||||
|
||||
#include "libxrdp.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
int APP_CC
|
||||
xrdp_bitmap32_compress(char *in_data, int width, int height,
|
||||
struct stream *s, int bpp, int byte_limit,
|
||||
int start_line, struct stream *temp_s,
|
||||
int e)
|
||||
{
|
||||
return 0;
|
||||
}
|
@ -1,89 +0,0 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Jay Sorg 2004-2013
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* tcp layer
|
||||
*/
|
||||
|
||||
#include "libxrdp.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
struct xrdp_tcp *APP_CC
|
||||
xrdp_tcp_create(struct xrdp_iso *owner, struct trans *trans)
|
||||
{
|
||||
struct xrdp_tcp *self;
|
||||
|
||||
DEBUG((" in xrdp_tcp_create"));
|
||||
self = (struct xrdp_tcp *)g_malloc(sizeof(struct xrdp_tcp), 1);
|
||||
self->iso_layer = owner;
|
||||
self->trans = trans;
|
||||
DEBUG((" out xrdp_tcp_create"));
|
||||
return self;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void APP_CC
|
||||
xrdp_tcp_delete(struct xrdp_tcp *self)
|
||||
{
|
||||
g_free(self);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* get out stream ready for data */
|
||||
/* returns error */
|
||||
int APP_CC
|
||||
xrdp_tcp_init(struct xrdp_tcp *self, struct stream *s)
|
||||
{
|
||||
init_stream(s, 8192);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* returns error */
|
||||
int APP_CC
|
||||
xrdp_tcp_recv(struct xrdp_tcp *self, struct stream *s, int len)
|
||||
{
|
||||
DEBUG((" in xrdp_tcp_recv, gota get %d bytes", len));
|
||||
init_stream(s, len);
|
||||
|
||||
if (trans_force_read_s(self->trans, s, len) != 0)
|
||||
{
|
||||
DEBUG((" error in trans_force_read_s"));
|
||||
return 1;
|
||||
}
|
||||
|
||||
DEBUG((" out xrdp_tcp_recv"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* returns error */
|
||||
int APP_CC
|
||||
xrdp_tcp_send(struct xrdp_tcp *self, struct stream *s)
|
||||
{
|
||||
int len;
|
||||
len = s->end - s->data;
|
||||
DEBUG((" in xrdp_tcp_send, gota send %d bytes", len));
|
||||
|
||||
if (trans_force_write_s(self->trans, s) != 0)
|
||||
{
|
||||
DEBUG((" error in trans_force_write_s"));
|
||||
return 1;
|
||||
}
|
||||
|
||||
DEBUG((" out xrdp_tcp_send, sent %d bytes ok", len));
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
TS_SCardBeginTransaction:
|
||||
0000 03 00 00 93 02 f0 80 68 00 01 03 ed f0 80 84 08 .......h........
|
||||
0010 00 00 00 de 14 5c 5a 9e 86 37 2b 70 00 00 00 03 .....\Z..7+p....
|
||||
0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 02 ...rDRI.........
|
||||
0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 38 ...............8
|
||||
0040 00 00 00 bc 00 09 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................
|
||||
0060 cc cc cc 28 00 00 00 00 00 00 00 04 00 00 00 00 ...(............
|
||||
0070 00 02 00 04 00 00 00 04 00 02 00 00 00 00 00 04 ................
|
||||
0080 00 00 00 02 00 00 00 04 00 00 00 0a 00 00 00 00 ................
|
||||
0090 00 00 00 ...
|
||||
|
@ -0,0 +1,30 @@
|
||||
TS_SCardConnect:
|
||||
0000 03 00 00 cb 02 f0 80 68 00 01 03 ed f0 80 bc 08 .......h........
|
||||
0010 00 00 00 7b 28 f8 7e 5c c8 16 e8 a8 00 00 00 03 ...{(.~\........
|
||||
0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 ...rDRI.........
|
||||
0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 70 ...............p
|
||||
0040 00 00 00 b0 00 09 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................
|
||||
0060 cc cc cc 60 00 00 00 00 00 00 00 00 00 02 00 04 ...`............
|
||||
0070 00 00 00 04 00 02 00 02 00 00 00 03 00 00 00 19 ................
|
||||
0080 00 00 00 00 00 00 00 19 00 00 00 47 00 65 00 6d ...........G.e.m
|
||||
0090 00 70 00 6c 00 75 00 73 00 20 00 47 00 65 00 6d .p.l.u.s. .G.e.m
|
||||
00a0 00 50 00 43 00 20 00 54 00 77 00 69 00 6e 00 20 .P.C. .T.w.i.n.
|
||||
00b0 00 30 00 30 00 20 00 30 00 30 00 00 00 00 00 04 .0.0. .0.0......
|
||||
00c0 00 00 00 01 00 00 00 00 00 00 00 ...........
|
||||
TS_SCardConnect:
|
||||
0000 03 00 00 cb 02 f0 80 68 00 01 03 ed f0 80 bc 08 .......h........
|
||||
0010 00 00 00 7b 28 f8 7e 5c c8 16 e8 a8 00 00 00 03 ...{(.~\........
|
||||
0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 ...rDRI.........
|
||||
0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 70 ...............p
|
||||
0040 00 00 00 b0 00 09 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................
|
||||
0060 cc cc cc 60 00 00 00 00 00 00 00 00 00 02 00 04 ...`............
|
||||
0070 00 00 00 04 00 02 00 02 00 00 00 03 00 00 00 19 ................
|
||||
0080 00 00 00 00 00 00 00 19 00 00 00 47 00 65 00 6d ...........G.e.m
|
||||
0090 00 70 00 6c 00 75 00 73 00 20 00 47 00 65 00 6d .p.l.u.s. .G.e.m
|
||||
00a0 00 50 00 43 00 20 00 54 00 77 00 69 00 6e 00 20 .P.C. .T.w.i.n.
|
||||
00b0 00 30 00 30 00 20 00 30 00 30 00 00 00 00 00 04 .0.0. .0.0......
|
||||
00c0 00 00 00 01 00 00 00 00 00 00 00 ...........
|
||||
|
||||
|
@ -0,0 +1,61 @@
|
||||
TS_SCardControl:
|
||||
0000 03 00 00 a3 02 f0 80 68 00 01 03 ed f0 80 94 08 .......h........
|
||||
0010 00 00 00 05 18 7c 3e ca 9f 03 76 80 00 00 00 03 .....|>...v.....
|
||||
0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 00 ...rDRI.........
|
||||
0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 48 ...............H
|
||||
0040 00 00 00 d4 00 09 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................
|
||||
0060 cc cc cc 38 00 00 00 00 00 00 00 04 00 00 00 00 ...8............
|
||||
0070 00 02 00 04 00 00 00 04 00 02 00 20 35 31 00 00 ........... 51..
|
||||
0080 00 00 00 00 00 00 00 00 00 00 00 c8 00 00 00 04 ................
|
||||
0090 00 00 00 05 00 00 00 04 00 00 00 06 00 00 00 00 ................
|
||||
00a0 00 00 00 ...
|
||||
TS_SCardControl:
|
||||
0000 03 00 00 a3 02 f0 80 68 00 01 03 ed f0 80 94 08 .......h........
|
||||
0010 00 00 00 99 4c 06 de f1 41 78 64 80 00 00 00 03 ....L...Axd.....
|
||||
0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 ...rDRI.........
|
||||
0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 48 ...............H
|
||||
0040 00 00 00 d4 00 09 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................
|
||||
0060 cc cc cc 38 00 00 00 00 00 00 00 04 00 00 00 00 ...8............
|
||||
0070 00 02 00 04 00 00 00 04 00 02 00 20 35 31 00 00 ........... 51..
|
||||
0080 00 00 00 00 00 00 00 00 00 00 00 c8 00 00 00 04 ................
|
||||
0090 00 00 00 05 00 00 00 04 00 00 00 06 00 00 00 00 ................
|
||||
00a0 00 00 00 ...
|
||||
TS_SCardControl:
|
||||
0000 03 00 00 a3 02 f0 80 68 00 01 03 ed f0 80 94 08 .......h........
|
||||
0010 00 00 00 05 18 7c 3e ca 9f 03 76 80 00 00 00 03 .....|>...v.....
|
||||
0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 00 ...rDRI.........
|
||||
0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 48 ...............H
|
||||
0040 00 00 00 d4 00 09 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................
|
||||
0060 cc cc cc 38 00 00 00 00 00 00 00 04 00 00 00 00 ...8............
|
||||
0070 00 02 00 04 00 00 00 04 00 02 00 20 35 31 00 00 ........... 51..
|
||||
0080 00 00 00 00 00 00 00 00 00 00 00 c8 00 00 00 04 ................
|
||||
0090 00 00 00 05 00 00 00 04 00 00 00 06 00 00 00 00 ................
|
||||
00a0 00 00 00 ...
|
||||
TS_SCardControl:
|
||||
0000 03 00 00 a3 02 f0 80 68 00 01 03 ed f0 80 94 08 .......h........
|
||||
0010 00 00 00 99 4c 06 de f1 41 78 64 80 00 00 00 03 ....L...Axd.....
|
||||
0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 ...rDRI.........
|
||||
0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 48 ...............H
|
||||
0040 00 00 00 d4 00 09 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................
|
||||
0060 cc cc cc 38 00 00 00 00 00 00 00 04 00 00 00 00 ...8............
|
||||
0070 00 02 00 04 00 00 00 04 00 02 00 20 35 31 00 00 ........... 51..
|
||||
0080 00 00 00 00 00 00 00 00 00 00 00 c8 00 00 00 04 ................
|
||||
0090 00 00 00 05 00 00 00 04 00 00 00 06 00 00 00 00 ................
|
||||
00a0 00 00 00 ...
|
||||
TS_SCardControl:
|
||||
0000 03 00 00 a3 02 f0 80 68 00 01 03 ed f0 80 94 08 .......h........
|
||||
0010 00 00 00 87 62 bd 62 13 81 8a d6 80 00 00 00 03 ....b.b.........
|
||||
0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 ...rDRI.........
|
||||
0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 48 ...............H
|
||||
0040 00 00 00 d4 00 09 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................
|
||||
0060 cc cc cc 38 00 00 00 00 00 00 00 04 00 00 00 00 ...8............
|
||||
0070 00 02 00 04 00 00 00 04 00 02 00 20 35 31 00 00 ........... 51..
|
||||
0080 00 00 00 00 00 00 00 00 00 00 00 02 01 00 00 04 ................
|
||||
0090 00 00 00 07 00 00 00 04 00 00 00 0b 00 00 00 00 ................
|
||||
00a0 00 00 00 ...
|
||||
|
@ -0,0 +1,24 @@
|
||||
TS_SCardDisconnect:
|
||||
0000 03 00 00 93 02 f0 80 68 00 01 03 ed f0 80 84 08 .......h........
|
||||
0010 00 00 00 87 b4 3a 7f a4 2a 6d ad 70 00 00 00 03 .....:..*m.p....
|
||||
0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 00 ...rDRI.........
|
||||
0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 38 ...............8
|
||||
0040 00 00 00 b8 00 09 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................
|
||||
0060 cc cc cc 28 00 00 00 00 00 00 00 04 00 00 00 00 ...(............
|
||||
0070 00 02 00 04 00 00 00 04 00 02 00 00 00 00 00 04 ................
|
||||
0080 00 00 00 03 00 00 00 04 00 00 00 04 00 00 00 00 ................
|
||||
0090 00 00 00 ...
|
||||
TS_SCardDisconnect:
|
||||
0000 03 00 00 93 02 f0 80 68 00 01 03 ed f0 80 84 08 .......h........
|
||||
0010 00 00 00 72 7f fb 24 4e b1 36 c8 70 00 00 00 03 ...r..$N.6.p....
|
||||
0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 ...rDRI.........
|
||||
0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 38 ...............8
|
||||
0040 00 00 00 b8 00 09 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................
|
||||
0060 cc cc cc 28 00 00 00 00 00 00 00 04 00 00 00 00 ...(............
|
||||
0070 00 02 00 04 00 00 00 04 00 02 00 00 00 00 00 04 ................
|
||||
0080 00 00 00 04 00 00 00 04 00 00 00 05 00 00 00 00 ................
|
||||
0090 00 00 00 ...
|
||||
|
||||
|
@ -0,0 +1,35 @@
|
||||
TS_SCardEndTransaction:
|
||||
0000 03 00 00 93 02 f0 80 68 00 01 03 ed f0 80 84 08 .......h........
|
||||
0010 00 00 00 51 1c 06 7b 0a 94 e3 7f 70 00 00 00 03 ...Q..{....p....
|
||||
0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 02 ...rDRI.........
|
||||
0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 38 ...............8
|
||||
0040 00 00 00 c0 00 09 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................
|
||||
0060 cc cc cc 28 00 00 00 00 00 00 00 04 00 00 00 00 ...(............
|
||||
0070 00 02 00 04 00 00 00 04 00 02 00 00 00 00 00 04 ................
|
||||
0080 00 00 00 09 00 00 00 04 00 00 00 0a 00 00 00 00 ................
|
||||
0090 00 00 00 ...
|
||||
TS_SCardEndTransaction:
|
||||
0000 03 00 00 93 02 f0 80 68 00 01 03 ed f0 80 84 08 .......h........
|
||||
0010 00 00 00 51 1c 06 7b 0a 94 e3 7f 70 00 00 00 03 ...Q..{....p....
|
||||
0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 02 ...rDRI.........
|
||||
0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 38 ...............8
|
||||
0040 00 00 00 c0 00 09 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................
|
||||
0060 cc cc cc 28 00 00 00 00 00 00 00 04 00 00 00 00 ...(............
|
||||
0070 00 02 00 04 00 00 00 04 00 02 00 00 00 00 00 04 ................
|
||||
0080 00 00 00 09 00 00 00 04 00 00 00 0a 00 00 00 00 ................
|
||||
0090 00 00 00 ...
|
||||
TS_SCardEndTransaction:
|
||||
0000 03 00 00 93 02 f0 80 68 00 01 03 ed f0 80 84 08 .......h........
|
||||
0010 00 00 00 fe 1c ea fb 2e a3 58 a6 70 00 00 00 03 .........X.p....
|
||||
0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 03 ...rDRI.........
|
||||
0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 38 ...............8
|
||||
0040 00 00 00 c0 00 09 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................
|
||||
0060 cc cc cc 28 00 00 00 00 00 00 00 04 00 00 00 00 ...(............
|
||||
0070 00 02 00 04 00 00 00 04 00 02 00 00 00 00 00 04 ................
|
||||
0080 00 00 00 09 00 00 00 04 00 00 00 0a 00 00 00 00 ................
|
||||
0090 00 00 00 ...
|
||||
|
||||
|
@ -0,0 +1,19 @@
|
||||
TS_SCardEstablishContext:
|
||||
0000 03 00 00 72 02 f0 80 68 00 01 03 ed f0 64 08 00 ...r...h.....d..
|
||||
0010 00 00 a7 8d 52 74 fd 96 bc b4 50 00 00 00 03 00 ....Rt....P.....
|
||||
0020 00 00 72 44 52 49 00 00 00 00 01 00 00 00 00 00 ..rDRI..........
|
||||
0030 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 18 00 ................
|
||||
0040 00 00 14 00 09 00 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc cc ................
|
||||
0060 cc cc 08 00 00 00 00 00 00 00 02 00 00 00 00 00 ................
|
||||
0070 00 00 ..
|
||||
TS_SCardEstablishContext:
|
||||
0000 03 00 00 72 02 f0 80 68 00 01 03 ed f0 64 08 00 ...r...h.....d..
|
||||
0010 00 00 51 f7 43 00 73 65 44 53 50 00 00 00 03 00 ..Q.C.seDSP.....
|
||||
0020 00 00 72 44 52 49 00 00 00 00 01 00 00 00 00 00 ..rDRI..........
|
||||
0030 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 18 00 ................
|
||||
0040 00 00 14 00 09 00 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc cc ................
|
||||
0060 cc cc 08 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0070 00 00 ..
|
||||
|
@ -0,0 +1,25 @@
|
||||
TS_SCardGetStatusChange:
|
||||
0000 03 00 01 6b 02 f0 80 68 00 01 03 ed f0 81 5c 08 ...k...h......\.
|
||||
0010 00 00 00 bf 53 5b 23 43 71 9b 2b 48 01 00 00 03 ....S[#Cq.+H....
|
||||
0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 00 ...rDRI.........
|
||||
0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 10 ................
|
||||
0040 01 00 00 a4 00 09 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................
|
||||
0060 cc cc cc 00 01 00 00 00 00 00 00 04 00 00 00 00 ................
|
||||
0070 00 02 00 ff ff ff ff 02 00 00 00 04 00 02 00 04 ................
|
||||
0080 00 00 00 01 00 00 00 02 00 00 00 08 00 02 00 00 ................
|
||||
0090 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
|
||||
00a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
|
||||
00b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0c ................
|
||||
00c0 00 02 00 10 00 00 00 00 00 00 00 00 00 00 00 00 ................
|
||||
00d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
|
||||
00e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
|
||||
00f0 00 00 00 15 00 00 00 00 00 00 00 15 00 00 00 5c ...............\
|
||||
0100 00 5c 00 3f 00 50 00 6e 00 50 00 3f 00 5c 00 4e .\.?.P.n.P.?.\.N
|
||||
0110 00 6f 00 74 00 69 00 66 00 69 00 63 00 61 00 74 .o.t.i.f.i.c.a.t
|
||||
0120 00 69 00 6f 00 6e 00 00 00 00 00 19 00 00 00 00 .i.o.n..........
|
||||
0130 00 00 00 19 00 00 00 47 00 65 00 6d 00 70 00 6c .......G.e.m.p.l
|
||||
0140 00 75 00 73 00 20 00 47 00 65 00 6d 00 50 00 43 .u.s. .G.e.m.P.C
|
||||
0150 00 20 00 54 00 77 00 69 00 6e 00 20 00 30 00 30 . .T.w.i.n. .0.0
|
||||
0160 00 20 00 30 00 30 00 00 00 00 00 . .0.0.....
|
||||
|
@ -0,0 +1,94 @@
|
||||
TS_SCardListReaders:
|
||||
0000 03 00 00 b3 02 f0 80 68 00 01 03 ed f0 80 a4 08 .......h........
|
||||
0010 00 00 00 07 b5 7d d1 ba 7c 7e e9 90 00 00 00 03 .....}..|~......
|
||||
0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 00 ...rDRI.........
|
||||
0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 58 ...............X
|
||||
0040 00 00 00 2c 00 09 00 00 00 00 00 00 00 00 00 00 ...,............
|
||||
0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................
|
||||
0060 cc cc cc 48 00 00 00 00 00 00 00 04 00 00 00 00 ...H............
|
||||
0070 00 02 00 24 00 00 00 04 00 02 00 00 00 00 00 ff ...$............
|
||||
0080 ff ff ff 04 00 00 00 01 00 00 00 24 00 00 00 53 ...........$...S
|
||||
0090 00 43 00 61 00 72 00 64 00 24 00 41 00 6c 00 6c .C.a.r.d.$.A.l.l
|
||||
00a0 00 52 00 65 00 61 00 64 00 65 00 72 00 73 00 00 .R.e.a.d.e.r.s..
|
||||
00b0 00 00 00 ...
|
||||
TS_SCardListReaders:
|
||||
0000 03 00 00 8a 02 f0 80 68 00 01 03 ed f0 7c 08 00 .......h.....|..
|
||||
0010 00 00 ae 89 33 c1 0d 6b e2 bb 68 00 00 00 03 00 ....3..k..h.....
|
||||
0020 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 00 ..rDRI..........
|
||||
0030 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 30 00 ..............0.
|
||||
0040 00 00 28 00 09 00 00 00 00 00 00 00 00 00 00 00 ..(.............
|
||||
0050 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc cc ................
|
||||
0060 cc cc 20 00 00 00 00 00 00 00 04 00 00 00 00 00 .. .............
|
||||
0070 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 ................
|
||||
0080 00 00 04 00 00 00 02 00 00 00 ..........
|
||||
TS_SCardListReaders:
|
||||
0000 03 00 00 8a 02 f0 80 68 00 01 03 ed f0 7c 08 00 .......h.....|..
|
||||
0010 00 00 ef be 3f 08 43 ae 89 9b 68 00 00 00 03 00 ....?.C...h.....
|
||||
0020 00 00 72 44 52 49 00 00 00 00 01 00 00 00 02 00 ..rDRI..........
|
||||
0030 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 30 00 ..............0.
|
||||
0040 00 00 28 00 09 00 00 00 00 00 00 00 00 00 00 00 ..(.............
|
||||
0050 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc cc ................
|
||||
0060 cc cc 20 00 00 00 00 00 00 00 04 00 00 00 00 00 .. .............
|
||||
0070 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 ................
|
||||
0080 00 00 04 00 00 00 02 00 00 00 ..........
|
||||
TS_SCardListReaders:
|
||||
0000 03 00 00 8a 02 f0 80 68 00 01 03 ed f0 7c 08 00 .......h.....|..
|
||||
0010 00 00 ae 89 33 c1 0d 6b e2 bb 68 00 00 00 03 00 ....3..k..h.....
|
||||
0020 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 00 ..rDRI..........
|
||||
0030 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 30 00 ..............0.
|
||||
0040 00 00 28 00 09 00 00 00 00 00 00 00 00 00 00 00 ..(.............
|
||||
0050 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc cc ................
|
||||
0060 cc cc 20 00 00 00 00 00 00 00 04 00 00 00 00 00 .. .............
|
||||
0070 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 ................
|
||||
0080 00 00 04 00 00 00 02 00 00 00 ..........
|
||||
TS_SCardListReaders:
|
||||
0000 03 00 00 8a 02 f0 80 68 00 01 03 ed f0 7c 08 00 .......h.....|..
|
||||
0010 00 00 ae 89 33 c1 0d 6b e2 bb 68 00 00 00 03 00 ....3..k..h.....
|
||||
0020 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 00 ..rDRI..........
|
||||
0030 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 30 00 ..............0.
|
||||
0040 00 00 28 00 09 00 00 00 00 00 00 00 00 00 00 00 ..(.............
|
||||
0050 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc cc ................
|
||||
0060 cc cc 20 00 00 00 00 00 00 00 04 00 00 00 00 00 .. .............
|
||||
0070 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 ................
|
||||
0080 00 00 04 00 00 00 02 00 00 00 ..........
|
||||
TS_SCardListReaders:
|
||||
0000 03 00 00 8a 02 f0 80 68 00 01 03 ed f0 7c 08 00 .......h.....|..
|
||||
0010 00 00 ae 89 33 c1 0d 6b e2 bb 68 00 00 00 03 00 ....3..k..h.....
|
||||
0020 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 00 ..rDRI..........
|
||||
0030 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 30 00 ..............0.
|
||||
0040 00 00 28 00 09 00 00 00 00 00 00 00 00 00 00 00 ..(.............
|
||||
0050 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc cc ................
|
||||
0060 cc cc 20 00 00 00 00 00 00 00 04 00 00 00 00 00 .. .............
|
||||
0070 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 ................
|
||||
0080 00 00 04 00 00 00 02 00 00 00 ..........
|
||||
TS_SCardListReaders:
|
||||
0000 03 00 00 8a 02 f0 80 68 00 01 03 ed f0 7c 08 00 .......h.....|..
|
||||
0010 00 00 78 0a 67 31 92 fc d0 29 68 00 00 00 03 00 ..x.g1...)h.....
|
||||
0020 00 00 72 44 52 49 00 00 00 00 01 00 00 00 03 00 ..rDRI..........
|
||||
0030 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 30 00 ..............0.
|
||||
0040 00 00 28 00 09 00 00 00 00 00 00 00 00 00 00 00 ..(.............
|
||||
0050 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc cc ................
|
||||
0060 cc cc 20 00 00 00 00 00 00 00 04 00 00 00 00 00 .. .............
|
||||
0070 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 ................
|
||||
0080 00 00 04 00 00 00 02 00 00 00 ..........
|
||||
TS_SCardListReaders:
|
||||
0000 03 00 00 8a 02 f0 80 68 00 01 03 ed f0 7c 08 00 .......h.....|..
|
||||
0010 00 00 ae 89 33 c1 0d 6b e2 bb 68 00 00 00 03 00 ....3..k..h.....
|
||||
0020 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 00 ..rDRI..........
|
||||
0030 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 30 00 ..............0.
|
||||
0040 00 00 28 00 09 00 00 00 00 00 00 00 00 00 00 00 ..(.............
|
||||
0050 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc cc ................
|
||||
0060 cc cc 20 00 00 00 00 00 00 00 04 00 00 00 00 00 .. .............
|
||||
0070 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 ................
|
||||
0080 00 00 04 00 00 00 02 00 00 00 ..........
|
||||
TS_SCardListReaders:
|
||||
0000 03 00 00 8a 02 f0 80 68 00 01 03 ed f0 7c 08 00 .......h.....|..
|
||||
0010 00 00 ae 89 33 c1 0d 6b e2 bb 68 00 00 00 03 00 ....3..k..h.....
|
||||
0020 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 00 ..rDRI..........
|
||||
0030 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 30 00 ..............0.
|
||||
0040 00 00 28 00 09 00 00 00 00 00 00 00 00 00 00 00 ..(.............
|
||||
0050 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc cc ................
|
||||
0060 cc cc 20 00 00 00 00 00 00 00 04 00 00 00 00 00 .. .............
|
||||
0070 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 ................
|
||||
0080 00 00 04 00 00 00 02 00 00 00
|
||||
|
@ -0,0 +1,9 @@
|
||||
0000 03 00 00 7a 02 f0 80 68 00 01 03 ed f0 6c 08 00 ...z...h.....l..
|
||||
0010 00 00 c9 9d 01 9e ec 30 a3 4c 58 00 00 00 03 00 .......0.LX.....
|
||||
0020 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 00 ..rDRI..........
|
||||
0030 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 20 00 .............. .
|
||||
0040 00 00 18 00 09 00 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc cc ................
|
||||
0060 cc cc 10 00 00 00 00 00 00 00 04 00 00 00 00 00 ................
|
||||
0070 02 00 04 00 00 00 02 00 00 00 ..........
|
||||
|
@ -0,0 +1,122 @@
|
||||
TS_SCardStatus:
|
||||
0000 03 00 00 9b 02 f0 80 68 00 01 03 ed f0 80 8c 08 .......h........
|
||||
0010 00 00 00 0e 8b f9 50 1f 35 28 35 78 00 00 00 03 ......P.5(5x....
|
||||
0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 00 ...rDRI.........
|
||||
0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 40 ...............@
|
||||
0040 00 00 00 cc 00 09 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................
|
||||
0060 cc cc cc 30 00 00 00 00 00 00 00 04 00 00 00 00 ...0............
|
||||
0070 00 02 00 04 00 00 00 04 00 02 00 00 00 00 00 ff ................
|
||||
0080 ff ff ff 20 00 00 00 04 00 00 00 05 00 00 00 04 ... ............
|
||||
0090 00 00 00 06 00 00 00 00 00 00 00 ...........
|
||||
TS_SCardStatus:
|
||||
0000 03 00 00 9b 02 f0 80 68 00 01 03 ed f0 80 8c 08 .......h........
|
||||
0010 00 00 00 0e 8b f9 50 1f 35 28 35 78 00 00 00 03 ......P.5(5x....
|
||||
0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 00 ...rDRI.........
|
||||
0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 40 ...............@
|
||||
0040 00 00 00 cc 00 09 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................
|
||||
0060 cc cc cc 30 00 00 00 00 00 00 00 04 00 00 00 00 ...0............
|
||||
0070 00 02 00 04 00 00 00 04 00 02 00 00 00 00 00 ff ................
|
||||
0080 ff ff ff 20 00 00 00 04 00 00 00 05 00 00 00 04 ... ............
|
||||
0090 00 00 00 06 00 00 00 00 00 00 00 ...........
|
||||
TS_SCardStatus:
|
||||
0000 03 00 00 9b 02 f0 80 68 00 01 03 ed f0 80 8c 08 .......h........
|
||||
0010 00 00 00 88 05 07 8b 2a 3c f5 16 78 00 00 00 03 .......*<..x....
|
||||
0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 ...rDRI.........
|
||||
0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 40 ...............@
|
||||
0040 00 00 00 cc 00 09 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................
|
||||
0060 cc cc cc 30 00 00 00 00 00 00 00 04 00 00 00 00 ...0............
|
||||
0070 00 02 00 04 00 00 00 04 00 02 00 00 00 00 00 ff ................
|
||||
0080 ff ff ff 20 00 00 00 04 00 00 00 05 00 00 00 04 ... ............
|
||||
0090 00 00 00 06 00 00 00 00 00 00 00 ...........
|
||||
TS_SCardStatus:
|
||||
0000 03 00 00 9b 02 f0 80 68 00 01 03 ed f0 80 8c 08 .......h........
|
||||
0010 00 00 00 3b cf 96 d8 27 3f cd 9f 78 00 00 00 03 ...;...'?..x....
|
||||
0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 01 ...rDRI.........
|
||||
0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 40 ...............@
|
||||
0040 00 00 00 c8 00 09 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................
|
||||
0060 cc cc cc 30 00 00 00 00 00 00 00 04 00 00 00 00 ...0............
|
||||
0070 00 02 00 04 00 00 00 04 00 02 00 01 00 00 00 00 ................
|
||||
0080 00 00 00 40 00 00 00 04 00 00 00 07 00 00 00 04 ...@............
|
||||
0090 00 00 00 09 00 00 00 00 00 00 00 ...........
|
||||
TS_SCardStatus:
|
||||
0000 03 00 00 9b 02 f0 80 68 00 01 03 ed f0 80 8c 08 .......h........
|
||||
0010 00 00 00 a3 8c 93 16 6c 49 59 23 78 00 00 00 03 .......lIY#x....
|
||||
0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 02 ...rDRI.........
|
||||
0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 40 ...............@
|
||||
0040 00 00 00 c8 00 09 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................
|
||||
0060 cc cc cc 30 00 00 00 00 00 00 00 04 00 00 00 00 ...0............
|
||||
0070 00 02 00 04 00 00 00 04 00 02 00 01 00 00 00 00 ................
|
||||
0080 00 00 00 40 00 00 00 04 00 00 00 07 00 00 00 04 ...@............
|
||||
0090 00 00 00 09 00 00 00 00 00 00 00 ...........
|
||||
TS_SCardStatus:
|
||||
0000 03 00 00 9b 02 f0 80 68 00 01 03 ed f0 80 8c 08 .......h........
|
||||
0010 00 00 00 6d d0 36 aa 65 50 4c 88 78 00 00 00 03 ...m.6.ePL.x....
|
||||
0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 03 ...rDRI.........
|
||||
0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 40 ...............@
|
||||
0040 00 00 00 c8 00 09 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................
|
||||
0060 cc cc cc 30 00 00 00 00 00 00 00 04 00 00 00 00 ...0............
|
||||
0070 00 02 00 04 00 00 00 04 00 02 00 01 00 00 00 00 ................
|
||||
0080 00 00 00 40 00 00 00 04 00 00 00 07 00 00 00 04 ...@............
|
||||
0090 00 00 00 09 00 00 00 00 00 00 00 ...........
|
||||
TS_SCardStatus:
|
||||
0000 03 00 00 9b 02 f0 80 68 00 01 03 ed f0 80 8c 08 .......h........
|
||||
0010 00 00 00 a3 8c 93 16 6c 49 59 23 78 00 00 00 03 .......lIY#x....
|
||||
0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 02 ...rDRI.........
|
||||
0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 40 ...............@
|
||||
0040 00 00 00 c8 00 09 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................
|
||||
0060 cc cc cc 30 00 00 00 00 00 00 00 04 00 00 00 00 ...0............
|
||||
0070 00 02 00 04 00 00 00 04 00 02 00 01 00 00 00 00 ................
|
||||
0080 00 00 00 40 00 00 00 04 00 00 00 07 00 00 00 04 ...@............
|
||||
0090 00 00 00 09 00 00 00 00 00 00 00 ...........
|
||||
TS_SCardStatus:
|
||||
0000 03 00 00 9b 02 f0 80 68 00 01 03 ed f0 80 8c 08 .......h........
|
||||
0010 00 00 00 6d d0 36 aa 65 50 4c 88 78 00 00 00 03 ...m.6.ePL.x....
|
||||
0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 03 ...rDRI.........
|
||||
0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 40 ...............@
|
||||
0040 00 00 00 c8 00 09 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................
|
||||
0060 cc cc cc 30 00 00 00 00 00 00 00 04 00 00 00 00 ...0............
|
||||
0070 00 02 00 04 00 00 00 04 00 02 00 01 00 00 00 00 ................
|
||||
0080 00 00 00 40 00 00 00 04 00 00 00 07 00 00 00 04 ...@............
|
||||
0090 00 00 00 09 00 00 00 00 00 00 00 ...........
|
||||
TS_SCardStatus:
|
||||
0000 03 00 00 9b 02 f0 80 68 00 01 03 ed f0 80 8c 08 .......h........
|
||||
0010 00 00 00 6d d0 36 aa 65 50 4c 88 78 00 00 00 03 ...m.6.ePL.x....
|
||||
0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 03 ...rDRI.........
|
||||
0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 40 ...............@
|
||||
0040 00 00 00 c8 00 09 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................
|
||||
0060 cc cc cc 30 00 00 00 00 00 00 00 04 00 00 00 00 ...0............
|
||||
0070 00 02 00 04 00 00 00 04 00 02 00 01 00 00 00 00 ................
|
||||
0080 00 00 00 40 00 00 00 04 00 00 00 07 00 00 00 04 ...@............
|
||||
0090 00 00 00 09 00 00 00 00 00 00 00 ...........
|
||||
TS_SCardStatus:
|
||||
0000 03 00 00 9b 02 f0 80 68 00 01 03 ed f0 80 8c 08 .......h........
|
||||
0010 00 00 00 a3 8c 93 16 6c 49 59 23 78 00 00 00 03 .......lIY#x....
|
||||
0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 02 ...rDRI.........
|
||||
0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 40 ...............@
|
||||
0040 00 00 00 c8 00 09 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................
|
||||
0060 cc cc cc 30 00 00 00 00 00 00 00 04 00 00 00 00 ...0............
|
||||
0070 00 02 00 04 00 00 00 04 00 02 00 01 00 00 00 00 ................
|
||||
0080 00 00 00 40 00 00 00 04 00 00 00 07 00 00 00 04 ...@............
|
||||
0090 00 00 00 09 00 00 00 00 00 00 00 ...........
|
||||
TS_SCardStatus:
|
||||
0000 03 00 00 9b 02 f0 80 68 00 01 03 ed f0 80 8c 08 .......h........
|
||||
0010 00 00 00 6d d0 36 aa 65 50 4c 88 78 00 00 00 03 ...m.6.ePL.x....
|
||||
0020 00 00 00 72 44 52 49 00 00 00 00 01 00 00 00 03 ...rDRI.........
|
||||
0030 00 00 00 0e 00 00 00 00 00 00 00 00 08 00 00 40 ...............@
|
||||
0040 00 00 00 c8 00 09 00 00 00 00 00 00 00 00 00 00 ................
|
||||
0050 00 00 00 00 00 00 00 00 00 00 00 01 10 08 00 cc ................
|
||||
0060 cc cc cc 30 00 00 00 00 00 00 00 04 00 00 00 00 ...0............
|
||||
0070 00 02 00 04 00 00 00 04 00 02 00 01 00 00 00 00 ................
|
||||
0080 00 00 00 40 00 00 00 04 00 00 00 07 00 00 00 04 ...@............
|
||||
0090 00 00 00 09 00 00 00 00 00 00 00 ...........
|
||||
|
@ -0,0 +1,34 @@
|
||||
TS_SCardTransmit:
|
||||
0000 01 10 08 00 cc cc cc cc 58 00 00 00 00 00 00 00 ........X.......
|
||||
0010 04 00 00 00 00 00 02 00 04 00 00 00 04 00 02 00 ................
|
||||
0020 01 00 00 00 00 00 00 00 00 00 00 00 07 00 00 00 ................
|
||||
0030 08 00 02 00 0c 00 02 00 00 00 00 00 02 01 00 00 ................
|
||||
0040 04 00 00 00 05 00 00 00 04 00 00 00 0b 00 00 00 ................
|
||||
0050 07 00 00 00 00 a4 02 0c 02 ef 0f 00 01 00 00 00 ................
|
||||
0060 00 00 00 00 00 00 00 00 ........
|
||||
TS_SCardTransmit:
|
||||
0000 01 10 08 00 cc cc cc cc 58 00 00 00 00 00 00 00 ........X.......
|
||||
0010 04 00 00 00 00 00 02 00 04 00 00 00 04 00 02 00 ................
|
||||
0020 01 00 00 00 00 00 00 00 00 00 00 00 05 00 00 00 ................
|
||||
0030 08 00 02 00 0c 00 02 00 00 00 00 00 02 01 00 00 ................
|
||||
0040 04 00 00 00 05 00 00 00 04 00 00 00 0b 00 00 00 ................
|
||||
0050 05 00 00 00 00 b0 07 5b 10 00 00 00 01 00 00 00 .......[........
|
||||
0060 00 00 00 00 00 00 00 00 ........
|
||||
TS_SCardTransmit:
|
||||
0000 01 10 08 00 cc cc cc cc 58 00 00 00 00 00 00 00 ........X.......
|
||||
0010 04 00 00 00 00 00 02 00 04 00 00 00 04 00 02 00 ................
|
||||
0020 01 00 00 00 00 00 00 00 00 00 00 00 07 00 00 00 ................
|
||||
0030 08 00 02 00 0c 00 02 00 00 00 00 00 02 01 00 00 ................
|
||||
0040 04 00 00 00 05 00 00 00 04 00 00 00 0b 00 00 00 ................
|
||||
0050 07 00 00 00 00 a4 02 0c 02 ef 10 00 01 00 00 00 ................
|
||||
0060 00 00 00 00 00 00 00 00 ........
|
||||
TS_SCardTransmit:
|
||||
0000 01 10 08 00 cc cc cc cc 58 00 00 00 00 00 00 00 ........X.......
|
||||
0010 04 00 00 00 00 00 02 00 04 00 00 00 04 00 02 00 ................
|
||||
0020 01 00 00 00 00 00 00 00 00 00 00 00 05 00 00 00 ................
|
||||
0030 08 00 02 00 0c 00 02 00 00 00 00 00 02 01 00 00 ................
|
||||
0040 04 00 00 00 05 00 00 00 04 00 00 00 0b 00 00 00 ................
|
||||
0050 05 00 00 00 00 b0 07 04 10 00 00 00 01 00 00 00 ................
|
||||
0060 00 00 00 00 00 00 00 00 ........
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
|
||||
CC=bcc32.exe
|
||||
|
||||
CFLAGS=-O2
|
||||
|
||||
OBJS=winscard.obj
|
||||
|
||||
winscard.dll: $(OBJS)
|
||||
$(CC) -ewinscard.dll -tWD $(OBJS)
|
||||
|
||||
clean:
|
||||
-del winscard.dll
|
||||
-del *.obj
|
||||
-del *.tds
|
@ -0,0 +1,78 @@
|
||||
ClassInstall32
|
||||
SCardAccessNewReaderEvent
|
||||
SCardReleaseAllEvents
|
||||
SCardReleaseNewReaderEvent
|
||||
SCardAccessStartedEvent
|
||||
|
||||
done SCardAddReaderToGroupA
|
||||
done SCardAddReaderToGroupW
|
||||
done SCardBeginTransaction
|
||||
done SCardCancel
|
||||
done SCardConnectA
|
||||
done SCardConnectW
|
||||
done SCardControl
|
||||
done SCardDisconnect
|
||||
done SCardEndTransaction
|
||||
done SCardEstablishContext
|
||||
done SCardForgetCardTypeA
|
||||
done SCardForgetCardTypeW
|
||||
done SCardForgetReaderA
|
||||
done SCardForgetReaderGroupA
|
||||
done SCardForgetReaderGroupW
|
||||
done SCardForgetReaderW
|
||||
done SCardFreeMemory
|
||||
done SCardGetAttrib
|
||||
done SCardGetCardTypeProviderNameA
|
||||
done SCardGetCardTypeProviderNameW
|
||||
done SCardGetProviderIdA
|
||||
done SCardGetProviderIdW
|
||||
done SCardGetStatusChangeA
|
||||
done SCardGetStatusChangeW
|
||||
|
||||
SCardGetTransmitCount
|
||||
|
||||
done SCardIntroduceCardTypeA
|
||||
done SCardIntroduceCardTypeW
|
||||
done SCardIntroduceReaderA
|
||||
done SCardIntroduceReaderGroupA
|
||||
done SCardIntroduceReaderGroupW
|
||||
done SCardIntroduceReaderW
|
||||
done SCardIsValidContext
|
||||
done SCardListCardsA
|
||||
done SCardListCardsW
|
||||
done SCardListInterfacesA
|
||||
done SCardListInterfacesW
|
||||
done SCardListReaderGroupsA
|
||||
done SCardListReaderGroupsW
|
||||
done SCardListReadersA
|
||||
done SCardListReadersW
|
||||
done SCardLocateCardsA
|
||||
|
||||
SCardLocateCardsByATRA
|
||||
SCardLocateCardsByATRW
|
||||
|
||||
done SCardLocateCardsW
|
||||
|
||||
SCardReadCacheA
|
||||
SCardReadCacheW
|
||||
|
||||
done SCardReconnect
|
||||
done SCardReleaseContext
|
||||
|
||||
SCardReleaseStartedEvent
|
||||
|
||||
done SCardRemoveReaderFromGroupA
|
||||
done SCardRemoveReaderFromGroupW
|
||||
done SCardSetAttrib
|
||||
done SCardSetCardTypeProviderNameA
|
||||
done SCardSetCardTypeProviderNameW
|
||||
done SCardState
|
||||
done SCardStatusA
|
||||
done SCardStatusW
|
||||
done SCardTransmit
|
||||
|
||||
SCardWriteCacheA
|
||||
SCardWriteCacheW
|
||||
g_rgSCardRawPci
|
||||
g_rgSCardT0Pci
|
||||
g_rgSCardT1Pci
|
@ -0,0 +1,171 @@
|
||||
|
||||
#ifndef _WINSCARD_FUNCS_H
|
||||
#define _WINSCARD_FUNCS_H
|
||||
|
||||
typedef LONG WINAPI
|
||||
(*tSCardEstablishContext)(DWORD dwScope, LPCVOID pvReserved1,
|
||||
LPCVOID pvReserved2, LPSCARDCONTEXT phContext);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardReleaseContext)(SCARDCONTEXT hContext);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardIsValidContext)(SCARDCONTEXT hContext);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardListReaderGroupsA)(SCARDCONTEXT hContext, LPSTR mszGroups,
|
||||
LPDWORD pcchGroups);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardListReaderGroupsW)(SCARDCONTEXT hContext, LPWSTR mszGroups,
|
||||
LPDWORD pcchGroups);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardListReadersA)(SCARDCONTEXT hContext, LPCSTR mszGroups,
|
||||
LPSTR mszReaders, LPDWORD pcchReaders);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardListReadersW)(SCARDCONTEXT hContext, LPCWSTR mszGroups,
|
||||
LPWSTR mszReaders, LPDWORD pcchReaders);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardListCardsA)(SCARDCONTEXT hContext, LPCBYTE pbAtr,
|
||||
LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount,
|
||||
LPSTR mszCards, LPDWORD pcchCards);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardListCardsW)(SCARDCONTEXT hContext, LPCBYTE pbAtr,
|
||||
LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount,
|
||||
LPWSTR mszCards, LPDWORD pcchCards);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardListInterfacesA)(SCARDCONTEXT hContext, LPCSTR szCard,
|
||||
LPGUID pguidInterfaces, LPDWORD pcguidInterfaces);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardListInterfacesW)(SCARDCONTEXT hContext, LPCWSTR szCard,
|
||||
LPGUID pguidInterfaces, LPDWORD pcguidInterfaces);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardGetProviderIdA)(SCARDCONTEXT hContext, LPCSTR szCard,
|
||||
LPGUID pguidProviderId);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardGetProviderIdW)(SCARDCONTEXT hContext, LPCWSTR szCard,
|
||||
LPGUID pguidProviderId);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardGetCardTypeProviderNameA)(SCARDCONTEXT hContext, LPCSTR szCardName,
|
||||
DWORD dwProviderId, LPSTR szProvider,
|
||||
LPDWORD pcchProvider);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardGetCardTypeProviderNameW)(SCARDCONTEXT hContext, LPCWSTR szCardName,
|
||||
DWORD dwProviderId, LPWSTR szProvider,
|
||||
LPDWORD pcchProvider);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardIntroduceReaderGroupA)(SCARDCONTEXT hContext, LPCSTR szGroupName);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardIntroduceReaderGroupW)(SCARDCONTEXT hContext, LPCWSTR szGroupName);
|
||||
|
||||
typedef LONG WINAPI
|
||||
(*tSCardForgetReaderGroupA)(SCARDCONTEXT hContext, LPCSTR szGroupName);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardForgetReaderGroupW)(SCARDCONTEXT hContext, LPCWSTR szGroupName);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardIntroduceReaderA)(SCARDCONTEXT hContext, LPCSTR szReaderName,
|
||||
LPCSTR szDeviceName);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardIntroduceReaderW)(SCARDCONTEXT hContext, LPCWSTR szReaderName,
|
||||
LPCWSTR szDeviceName);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardForgetReaderA)(SCARDCONTEXT hContext, LPCSTR szReaderName);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardForgetReaderW)(SCARDCONTEXT hContext, LPCWSTR szReaderName);
|
||||
|
||||
typedef LONG WINAPI
|
||||
(*tSCardAddReaderToGroupA)(SCARDCONTEXT hContext, LPCSTR szReaderName,
|
||||
LPCSTR szGroupName);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardAddReaderToGroupW)(SCARDCONTEXT hContext, LPCWSTR szReaderName,
|
||||
LPCWSTR szGroupName);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardRemoveReaderFromGroupA)(SCARDCONTEXT hContext, LPCSTR szReaderName,
|
||||
LPCSTR szGroupName);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardRemoveReaderFromGroupW)(SCARDCONTEXT hContext, LPCWSTR szReaderName,
|
||||
LPCWSTR szGroupName);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardIntroduceCardTypeA)(SCARDCONTEXT hContext, LPCSTR szCardName,
|
||||
LPCGUID pguidPrimaryProvider,
|
||||
LPCGUID rgguidInterfaces,
|
||||
DWORD dwInterfaceCount, LPCBYTE pbAtr,
|
||||
LPCBYTE pbAtrMask, DWORD cbAtrLen);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardIntroduceCardTypeW)(SCARDCONTEXT hContext, LPCWSTR szCardName,
|
||||
LPCGUID pguidPrimaryProvider,
|
||||
LPCGUID rgguidInterfaces,
|
||||
DWORD dwInterfaceCount, LPCBYTE pbAtr,
|
||||
LPCBYTE pbAtrMask, DWORD cbAtrLen);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardSetCardTypeProviderNameA)(SCARDCONTEXT hContext, LPCSTR szCardName,
|
||||
DWORD dwProviderId, LPCSTR szProvider);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardSetCardTypeProviderNameW)(SCARDCONTEXT hContext, LPCWSTR szCardName,
|
||||
DWORD dwProviderId, LPCWSTR szProvider);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardForgetCardTypeA)(SCARDCONTEXT hContext, LPCSTR szCardName);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardForgetCardTypeW)(SCARDCONTEXT hContext, LPCWSTR szCardName);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardFreeMemory)(SCARDCONTEXT hContext, LPCVOID pvMem);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardLocateCardsA)(SCARDCONTEXT hContext, LPCSTR mszCards,
|
||||
LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardLocateCardsW)(SCARDCONTEXT hContext, LPCWSTR mszCards,
|
||||
LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardGetStatusChangeA)(SCARDCONTEXT hContext, DWORD dwTimeout,
|
||||
LPSCARD_READERSTATEA rgReaderStates,
|
||||
DWORD cReaders);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardGetStatusChangeW)(SCARDCONTEXT hContext, DWORD dwTimeout,
|
||||
LPSCARD_READERSTATEW rgReaderStates,
|
||||
DWORD cReaders);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardCancel)(SCARDCONTEXT hContext);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardConnectA)(SCARDCONTEXT hContext, LPCSTR szReader,
|
||||
DWORD dwShareMode, DWORD dwPreferredProtocols,
|
||||
LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardConnectW)(SCARDCONTEXT hContext, LPCWSTR szReader,
|
||||
DWORD dwShareMode, DWORD dwPreferredProtocols,
|
||||
LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardReconnect)(SCARDHANDLE hCard, DWORD dwShareMode,
|
||||
DWORD dwPreferredProtocols, DWORD dwInitialization,
|
||||
LPDWORD pdwActiveProtocol);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardDisconnect)(SCARDHANDLE hCard, DWORD dwDisposition);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardBeginTransaction)(SCARDHANDLE hCard);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardEndTransaction)(SCARDHANDLE hCard, DWORD dwDisposition);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardCancelTransaction)(SCARDHANDLE hCard);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardState)(SCARDHANDLE hCard, LPDWORD pdwState, LPDWORD pdwProtocol,
|
||||
LPBYTE pbAtr, LPDWORD pcbAtrLen);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardStatusA)(SCARDHANDLE hCard, LPSTR szReaderName, LPDWORD pcchReaderLen,
|
||||
LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr,
|
||||
LPDWORD pcbAtrLen);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardStatusW)(SCARDHANDLE hCard, LPWSTR szReaderName, LPDWORD pcchReaderLen,
|
||||
LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr,
|
||||
LPDWORD pcbAtrLen);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardTransmit)(SCARDHANDLE hCard, LPCSCARD_IO_REQUEST pioSendPci,
|
||||
LPCBYTE pbSendBuffer, DWORD cbSendLength,
|
||||
LPSCARD_IO_REQUEST pioRecvPci, LPBYTE pbRecvBuffer,
|
||||
LPDWORD pcbRecvLength);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardControl)(SCARDHANDLE hCard, DWORD dwControlCode, LPCVOID lpInBuffer,
|
||||
DWORD nInBufferSize, LPVOID lpOutBuffer,
|
||||
DWORD nOutBufferSize, LPDWORD lpBytesReturned);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardGetAttrib)(SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE pbAttr,
|
||||
LPDWORD pcbAttrLen);
|
||||
typedef LONG WINAPI
|
||||
(*tSCardSetAttrib)(SCARDHANDLE hCard, DWORD dwAttrId, LPCBYTE pbAttr,
|
||||
DWORD cbAttrLen);
|
||||
|
||||
#endif
|
@ -0,0 +1,757 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <windows.h>
|
||||
|
||||
#include "winscard-funcs.h"
|
||||
|
||||
#define LUNUSED(_param) (void) _param
|
||||
|
||||
static tSCardEstablishContext aSCardEstablishContext;
|
||||
static tSCardReleaseContext aSCardReleaseContext;
|
||||
static tSCardIsValidContext aSCardIsValidContext;
|
||||
static tSCardListReaderGroupsA aSCardListReaderGroupsA;
|
||||
static tSCardListReaderGroupsW aSCardListReaderGroupsW;
|
||||
static tSCardListReadersA aSCardListReadersA;
|
||||
static tSCardListReadersW aSCardListReadersW;
|
||||
static tSCardListCardsA aSCardListCardsA;
|
||||
static tSCardListCardsW aSCardListCardsW;
|
||||
static tSCardListInterfacesA aSCardListInterfacesA;
|
||||
static tSCardListInterfacesW aSCardListInterfacesW;
|
||||
static tSCardGetProviderIdA aSCardGetProviderIdA;
|
||||
static tSCardGetProviderIdW aSCardGetProviderIdW;
|
||||
static tSCardGetCardTypeProviderNameA aSCardGetCardTypeProviderNameA;
|
||||
static tSCardGetCardTypeProviderNameW aSCardGetCardTypeProviderNameW;
|
||||
static tSCardIntroduceReaderGroupA aSCardIntroduceReaderGroupA;
|
||||
static tSCardIntroduceReaderGroupW aSCardIntroduceReaderGroupW;
|
||||
static tSCardForgetReaderGroupA aSCardForgetReaderGroupA;
|
||||
static tSCardForgetReaderGroupW aSCardForgetReaderGroupW;
|
||||
static tSCardIntroduceReaderA aSCardIntroduceReaderA;
|
||||
static tSCardIntroduceReaderW aSCardIntroduceReaderW;
|
||||
static tSCardForgetReaderA aSCardForgetReaderA;
|
||||
static tSCardForgetReaderW aSCardForgetReaderW;
|
||||
static tSCardAddReaderToGroupA aSCardAddReaderToGroupA;
|
||||
static tSCardAddReaderToGroupW aSCardAddReaderToGroupW;
|
||||
static tSCardRemoveReaderFromGroupA aSCardRemoveReaderFromGroupA;
|
||||
static tSCardRemoveReaderFromGroupW aSCardRemoveReaderFromGroupW;
|
||||
static tSCardIntroduceCardTypeA aSCardIntroduceCardTypeA;
|
||||
static tSCardIntroduceCardTypeW aSCardIntroduceCardTypeW;
|
||||
static tSCardSetCardTypeProviderNameA aSCardSetCardTypeProviderNameA;
|
||||
static tSCardSetCardTypeProviderNameW aSCardSetCardTypeProviderNameW;
|
||||
static tSCardForgetCardTypeA aSCardForgetCardTypeA;
|
||||
static tSCardForgetCardTypeW aSCardForgetCardTypeW;
|
||||
static tSCardFreeMemory aSCardFreeMemory;
|
||||
static tSCardLocateCardsA aSCardLocateCardsA;
|
||||
static tSCardLocateCardsW aSCardLocateCardsW;
|
||||
static tSCardGetStatusChangeA aSCardGetStatusChangeA;
|
||||
static tSCardGetStatusChangeW aSCardGetStatusChangeW;
|
||||
static tSCardCancel aSCardCancel;
|
||||
static tSCardConnectA aSCardConnectA;
|
||||
static tSCardConnectW aSCardConnectW;
|
||||
static tSCardReconnect aSCardReconnect;
|
||||
static tSCardDisconnect aSCardDisconnect;
|
||||
static tSCardBeginTransaction aSCardBeginTransaction;
|
||||
static tSCardEndTransaction aSCardEndTransaction;
|
||||
static tSCardCancelTransaction aSCardCancelTransaction;
|
||||
static tSCardState aSCardState;
|
||||
static tSCardStatusA aSCardStatusA;
|
||||
static tSCardStatusW aSCardStatusW;
|
||||
static tSCardTransmit aSCardTransmit;
|
||||
static tSCardControl aSCardControl;
|
||||
static tSCardGetAttrib aSCardGetAttrib;
|
||||
static tSCardSetAttrib aSCardSetAttrib;
|
||||
|
||||
//__declspec(dllexport) const SCARD_IO_REQUEST g_rgSCardT0Pci = { 0 };
|
||||
//__declspec(dllexport) const SCARD_IO_REQUEST g_rgSCardT1Pci = { 0 };
|
||||
//__declspec(dllexport) const SCARD_IO_REQUEST g_rgSCardRawPci = { 0 };
|
||||
|
||||
static int g_true = 1;
|
||||
|
||||
#define LLOGLN(_level, _args) do { if ((_level < 11) && g_true) { writeln _args ; } } while (0)
|
||||
|
||||
/*****************************************************************************/
|
||||
static int
|
||||
writeln(const char* format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char text[256];
|
||||
|
||||
va_start(ap, format);
|
||||
vsnprintf(text, 255, format, ap);
|
||||
va_end(ap);
|
||||
OutputDebugString(text);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define LLOAD(_func, _type, _name) \
|
||||
do { \
|
||||
_func = (_type) GetProcAddress(lib, _name); \
|
||||
if (_func == 0) \
|
||||
{ \
|
||||
writeln("LLOAD error %s", _name); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
static int g_funcs_loaded = 0;
|
||||
|
||||
/*****************************************************************************/
|
||||
static int __fastcall
|
||||
load_funsc(void)
|
||||
{
|
||||
HMODULE lib;
|
||||
|
||||
if (g_funcs_loaded)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
g_funcs_loaded = 1;
|
||||
lib = LoadLibrary("winscard-org.dll");
|
||||
LLOGLN(0, ("load_funsc: lib %p", lib));
|
||||
LLOAD(aSCardEstablishContext, tSCardEstablishContext, "SCardEstablishContext");
|
||||
LLOAD(aSCardReleaseContext, tSCardReleaseContext, "SCardReleaseContext");
|
||||
LLOAD(aSCardIsValidContext, tSCardIsValidContext, "SCardIsValidContext");
|
||||
LLOAD(aSCardListReaderGroupsA, tSCardListReaderGroupsA, "SCardListReaderGroupsA");
|
||||
LLOAD(aSCardListReaderGroupsW, tSCardListReaderGroupsW, "SCardListReaderGroupsW");
|
||||
LLOAD(aSCardListReadersA, tSCardListReadersA, "SCardListReadersA");
|
||||
LLOAD(aSCardListReadersW, tSCardListReadersW, "SCardListReadersW");
|
||||
LLOAD(aSCardListCardsA, tSCardListCardsA, "SCardListCardsA");
|
||||
LLOAD(aSCardListCardsW, tSCardListCardsW, "SCardListCardsW");
|
||||
LLOAD(aSCardListInterfacesA, tSCardListInterfacesA, "SCardListInterfacesA");
|
||||
LLOAD(aSCardListInterfacesW, tSCardListInterfacesW, "SCardListInterfacesW");
|
||||
LLOAD(aSCardGetProviderIdA, tSCardGetProviderIdA, "SCardGetProviderIdA");
|
||||
LLOAD(aSCardGetProviderIdW, tSCardGetProviderIdW, "SCardGetProviderIdW");
|
||||
LLOAD(aSCardGetCardTypeProviderNameA, tSCardGetCardTypeProviderNameA, "SCardGetCardTypeProviderNameA");
|
||||
LLOAD(aSCardGetCardTypeProviderNameW, tSCardGetCardTypeProviderNameW, "SCardGetCardTypeProviderNameW");
|
||||
LLOAD(aSCardIntroduceReaderGroupA, tSCardIntroduceReaderGroupA, "SCardIntroduceReaderGroupA");
|
||||
LLOAD(aSCardIntroduceReaderGroupW, tSCardIntroduceReaderGroupW, "SCardIntroduceReaderGroupW");
|
||||
LLOAD(aSCardForgetReaderGroupA, tSCardForgetReaderGroupA, "SCardForgetReaderGroupA");
|
||||
LLOAD(aSCardForgetReaderGroupW, tSCardForgetReaderGroupW, "SCardForgetReaderGroupW");
|
||||
LLOAD(aSCardIntroduceReaderA, tSCardIntroduceReaderA, "SCardIntroduceReaderA");
|
||||
LLOAD(aSCardIntroduceReaderW, tSCardIntroduceReaderW, "SCardIntroduceReaderW");
|
||||
LLOAD(aSCardForgetReaderA, tSCardForgetReaderA, "SCardForgetReaderA");
|
||||
LLOAD(aSCardForgetReaderW, tSCardForgetReaderW, "SCardForgetReaderW");
|
||||
LLOAD(aSCardAddReaderToGroupA, tSCardAddReaderToGroupA, "SCardAddReaderToGroupA");
|
||||
LLOAD(aSCardAddReaderToGroupW, tSCardAddReaderToGroupW, "SCardAddReaderToGroupW");
|
||||
LLOAD(aSCardRemoveReaderFromGroupA, tSCardRemoveReaderFromGroupA, "SCardRemoveReaderFromGroupA");
|
||||
LLOAD(aSCardRemoveReaderFromGroupW, tSCardRemoveReaderFromGroupW, "SCardRemoveReaderFromGroupW");
|
||||
LLOAD(aSCardIntroduceCardTypeA, tSCardIntroduceCardTypeA, "SCardIntroduceCardTypeA");
|
||||
LLOAD(aSCardIntroduceCardTypeW, tSCardIntroduceCardTypeW, "SCardIntroduceCardTypeW");
|
||||
LLOAD(aSCardSetCardTypeProviderNameA, tSCardSetCardTypeProviderNameA, "SCardSetCardTypeProviderNameA");
|
||||
LLOAD(aSCardSetCardTypeProviderNameW, tSCardSetCardTypeProviderNameW, "SCardSetCardTypeProviderNameW");
|
||||
LLOAD(aSCardForgetCardTypeA, tSCardForgetCardTypeA, "SCardForgetCardTypeA");
|
||||
LLOAD(aSCardForgetCardTypeW, tSCardForgetCardTypeW, "SCardForgetCardTypeW");
|
||||
LLOAD(aSCardFreeMemory, tSCardFreeMemory, "SCardFreeMemory");
|
||||
LLOAD(aSCardLocateCardsA, tSCardLocateCardsA, "SCardLocateCardsA");
|
||||
LLOAD(aSCardLocateCardsW, tSCardLocateCardsW, "SCardLocateCardsW");
|
||||
LLOAD(aSCardGetStatusChangeA, tSCardGetStatusChangeA, "SCardGetStatusChangeA");
|
||||
LLOAD(aSCardGetStatusChangeW, tSCardGetStatusChangeW, "SCardGetStatusChangeW");
|
||||
LLOAD(aSCardCancel, tSCardCancel, "SCardCancel");
|
||||
LLOAD(aSCardConnectA, tSCardConnectA, "SCardConnectA");
|
||||
LLOAD(aSCardConnectW, tSCardConnectW, "SCardConnectW");
|
||||
LLOAD(aSCardReconnect, tSCardReconnect, "SCardReconnect");
|
||||
LLOAD(aSCardDisconnect, tSCardDisconnect, "SCardDisconnect");
|
||||
LLOAD(aSCardBeginTransaction, tSCardBeginTransaction, "SCardBeginTransaction");
|
||||
LLOAD(aSCardEndTransaction, tSCardEndTransaction, "SCardEndTransaction");
|
||||
LLOAD(aSCardCancelTransaction, tSCardCancelTransaction, "SCardCancelTransaction");
|
||||
LLOAD(aSCardState, tSCardState, "SCardState");
|
||||
LLOAD(aSCardStatusA, tSCardStatusA, "SCardStatusA");
|
||||
LLOAD(aSCardStatusW, tSCardStatusW, "SCardStatusW");
|
||||
LLOAD(aSCardTransmit, tSCardTransmit, "SCardTransmit");
|
||||
LLOAD(aSCardControl, tSCardControl, "SCardControl");
|
||||
LLOAD(aSCardGetAttrib, tSCardGetAttrib, "SCardGetAttrib");
|
||||
LLOAD(aSCardSetAttrib, tSCardSetAttrib, "SCardSetAttrib");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
BOOL WINAPI
|
||||
DllEntryPoint(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||
{
|
||||
BOOL rv;
|
||||
LUNUSED(hinstDLL);
|
||||
LUNUSED(lpvReserved);
|
||||
|
||||
LLOGLN(10, ("DllEntryPoint: hinstDLL %p fdwReason %d", hinstDLL, fdwReason));
|
||||
rv = FALSE;
|
||||
switch (fdwReason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
LLOGLN(0, ("DllEntryPoint: DLL_PROCESS_ATTACH"));
|
||||
load_funsc();
|
||||
rv = TRUE;
|
||||
break;
|
||||
case DLL_THREAD_ATTACH:
|
||||
LLOGLN(10, ("DllEntryPoint: DLL_THREAD_ATTACH"));
|
||||
rv = TRUE;
|
||||
break;
|
||||
case DLL_THREAD_DETACH:
|
||||
LLOGLN(10, ("DllEntryPoint: DLL_THREAD_DETACH"));
|
||||
rv = TRUE;
|
||||
break;
|
||||
case DLL_PROCESS_DETACH:
|
||||
LLOGLN(0, ("DllEntryPoint: DLL_PROCESS_DETACH"));
|
||||
rv = TRUE;
|
||||
break;
|
||||
default:
|
||||
LLOGLN(0, ("DllEntryPoint: unknown fdwReason %d", fdwReason));
|
||||
break;
|
||||
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardEstablishContext(DWORD dwScope, LPCVOID pvReserved1,
|
||||
LPCVOID pvReserved2, LPSCARDCONTEXT phContext)
|
||||
{
|
||||
LLOGLN(0, ("SCardEstablishContext:"));
|
||||
return aSCardEstablishContext(dwScope, pvReserved1, pvReserved2, phContext);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardReleaseContext(SCARDCONTEXT hContext)
|
||||
{
|
||||
LLOGLN(0, ("SCardReleaseContext:"));
|
||||
return aSCardReleaseContext(hContext);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardIsValidContext(SCARDCONTEXT hContext)
|
||||
{
|
||||
LLOGLN(0, ("SCardIsValidContext:"));
|
||||
return aSCardIsValidContext(hContext);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardListReaderGroupsA(SCARDCONTEXT hContext, LPSTR mszGroups,
|
||||
LPDWORD pcchGroups)
|
||||
{
|
||||
LLOGLN(0, ("SCardListReaderGroupsA:"));
|
||||
return aSCardListReaderGroupsA(hContext, mszGroups, pcchGroups);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardListReaderGroupsW(SCARDCONTEXT hContext, LPWSTR mszGroups,
|
||||
LPDWORD pcchGroups)
|
||||
{
|
||||
LLOGLN(0, ("SCardListReaderGroupsW:"));
|
||||
return aSCardListReaderGroupsW(hContext, mszGroups, pcchGroups);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardListReadersA(SCARDCONTEXT hContext, LPCSTR mszGroups,
|
||||
LPSTR mszReaders, LPDWORD pcchReaders)
|
||||
{
|
||||
LLOGLN(0, ("SCardListReadersA:"));
|
||||
return aSCardListReadersA(hContext, mszGroups, mszReaders, pcchReaders);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardListReadersW(SCARDCONTEXT hContext, LPCWSTR mszGroups,
|
||||
LPWSTR mszReaders, LPDWORD pcchReaders)
|
||||
{
|
||||
char text[256];
|
||||
LONG rv;
|
||||
DWORD cchReaders;
|
||||
|
||||
text[0] = 0;
|
||||
if (mszGroups != 0)
|
||||
{
|
||||
wcstombs(text, mszGroups, 255);
|
||||
}
|
||||
cchReaders = *pcchReaders;
|
||||
LLOGLN(0, ("SCardListReadersW: mszGroups [%s] cchReaders [%d]", text, *pcchReaders));
|
||||
rv = aSCardListReadersW(hContext, mszGroups, mszReaders, pcchReaders);
|
||||
text[0] = 0;
|
||||
if (cchReaders > 0)
|
||||
{
|
||||
wcstombs(text, mszReaders, 255);
|
||||
}
|
||||
LLOGLN(0, (" mszReaders [%s] cchReaders [%d]", text, *pcchReaders));
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardListCardsA(SCARDCONTEXT hContext, LPCBYTE pbAtr,
|
||||
LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount,
|
||||
LPSTR mszCards, LPDWORD pcchCards)
|
||||
{
|
||||
LLOGLN(0, ("SCardListCardsA:"));
|
||||
return aSCardListCardsA(hContext, pbAtr, rgquidInterfaces,
|
||||
cguidInterfaceCount, mszCards, pcchCards);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardListCardsW(SCARDCONTEXT hContext, LPCBYTE pbAtr,
|
||||
LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount,
|
||||
LPWSTR mszCards, LPDWORD pcchCards)
|
||||
{
|
||||
LLOGLN(0, ("SCardListCardsW:"));
|
||||
return aSCardListCardsW(hContext, pbAtr, rgquidInterfaces,
|
||||
cguidInterfaceCount, mszCards, pcchCards);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardListInterfacesA(SCARDCONTEXT hContext, LPCSTR szCard,
|
||||
LPGUID pguidInterfaces, LPDWORD pcguidInterfaces)
|
||||
{
|
||||
LLOGLN(0, ("SCardListInterfacesA:"));
|
||||
return aSCardListInterfacesA(hContext, szCard, pguidInterfaces,
|
||||
pcguidInterfaces);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardListInterfacesW(SCARDCONTEXT hContext, LPCWSTR szCard,
|
||||
LPGUID pguidInterfaces, LPDWORD pcguidInterfaces)
|
||||
{
|
||||
LLOGLN(0, ("SCardListInterfacesW:"));
|
||||
return aSCardListInterfacesW(hContext, szCard, pguidInterfaces,
|
||||
pcguidInterfaces);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardGetProviderIdA(SCARDCONTEXT hContext, LPCSTR szCard,
|
||||
LPGUID pguidProviderId)
|
||||
{
|
||||
LLOGLN(0, ("SCardGetProviderIdA:"));
|
||||
return aSCardGetProviderIdA(hContext, szCard, pguidProviderId);
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardGetProviderIdW(SCARDCONTEXT hContext, LPCWSTR szCard,
|
||||
LPGUID pguidProviderId)
|
||||
{
|
||||
LLOGLN(0, ("SCardGetProviderIdW:"));
|
||||
return aSCardGetProviderIdW(hContext, szCard, pguidProviderId);
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardGetCardTypeProviderNameA(SCARDCONTEXT hContext, LPCSTR szCardName,
|
||||
DWORD dwProviderId, LPSTR szProvider,
|
||||
LPDWORD pcchProvider)
|
||||
{
|
||||
LLOGLN(0, ("SCardGetCardTypeProviderNameA:"));
|
||||
return aSCardGetCardTypeProviderNameA(hContext, szCardName, dwProviderId,
|
||||
szProvider, pcchProvider);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardGetCardTypeProviderNameW(SCARDCONTEXT hContext, LPCWSTR szCardName,
|
||||
DWORD dwProviderId, LPWSTR szProvider,
|
||||
LPDWORD pcchProvider)
|
||||
{
|
||||
LLOGLN(0, ("SCardGetCardTypeProviderNameW:"));
|
||||
return aSCardGetCardTypeProviderNameW(hContext, szCardName, dwProviderId,
|
||||
szProvider, pcchProvider);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardIntroduceReaderGroupA(SCARDCONTEXT hContext, LPCSTR szGroupName)
|
||||
{
|
||||
LLOGLN(0, ("SCardIntroduceReaderGroupA:"));
|
||||
return aSCardIntroduceReaderGroupA(hContext, szGroupName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardIntroduceReaderGroupW(SCARDCONTEXT hContext, LPCWSTR szGroupName)
|
||||
{
|
||||
LLOGLN(0, ("SCardIntroduceReaderGroupW:"));
|
||||
return aSCardIntroduceReaderGroupW(hContext, szGroupName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardForgetReaderGroupA(SCARDCONTEXT hContext, LPCSTR szGroupName)
|
||||
{
|
||||
LLOGLN(0, ("SCardForgetReaderGroupA:"));
|
||||
return aSCardForgetReaderGroupA(hContext, szGroupName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardForgetReaderGroupW(SCARDCONTEXT hContext, LPCWSTR szGroupName)
|
||||
{
|
||||
LLOGLN(0, ("SCardForgetReaderGroupW:"));
|
||||
return aSCardForgetReaderGroupW(hContext, szGroupName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardIntroduceReaderA(SCARDCONTEXT hContext, LPCSTR szReaderName,
|
||||
LPCSTR szDeviceName)
|
||||
{
|
||||
LLOGLN(0, ("SCardIntroduceReaderA:"));
|
||||
return aSCardIntroduceReaderA(hContext, szReaderName, szDeviceName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardIntroduceReaderW(SCARDCONTEXT hContext, LPCWSTR szReaderName,
|
||||
LPCWSTR szDeviceName)
|
||||
{
|
||||
LLOGLN(0, ("SCardIntroduceReaderW:"));
|
||||
return aSCardIntroduceReaderW(hContext, szReaderName, szDeviceName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardForgetReaderA(SCARDCONTEXT hContext, LPCSTR szReaderName)
|
||||
{
|
||||
LLOGLN(0, ("SCardForgetReaderA:"));
|
||||
return aSCardForgetReaderA(hContext, szReaderName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardForgetReaderW(SCARDCONTEXT hContext, LPCWSTR szReaderName)
|
||||
{
|
||||
LLOGLN(0, ("SCardForgetReaderW:"));
|
||||
return aSCardForgetReaderW(hContext, szReaderName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardAddReaderToGroupA(SCARDCONTEXT hContext, LPCSTR szReaderName,
|
||||
LPCSTR szGroupName)
|
||||
{
|
||||
LLOGLN(0, ("SCardAddReaderToGroupA:"));
|
||||
return aSCardAddReaderToGroupA(hContext, szReaderName, szGroupName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardAddReaderToGroupW(SCARDCONTEXT hContext, LPCWSTR szReaderName,
|
||||
LPCWSTR szGroupName)
|
||||
{
|
||||
LLOGLN(0, ("SCardAddReaderToGroupW:"));
|
||||
return aSCardAddReaderToGroupW(hContext, szReaderName, szGroupName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardRemoveReaderFromGroupA(SCARDCONTEXT hContext, LPCSTR szReaderName,
|
||||
LPCSTR szGroupName)
|
||||
{
|
||||
LLOGLN(0, ("SCardRemoveReaderFromGroupA:"));
|
||||
return aSCardRemoveReaderFromGroupA(hContext, szReaderName, szGroupName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardRemoveReaderFromGroupW(SCARDCONTEXT hContext, LPCWSTR szReaderName,
|
||||
LPCWSTR szGroupName)
|
||||
{
|
||||
LLOGLN(0, ("SCardRemoveReaderFromGroupW:"));
|
||||
return aSCardRemoveReaderFromGroupW(hContext, szReaderName, szGroupName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardIntroduceCardTypeA(SCARDCONTEXT hContext, LPCSTR szCardName,
|
||||
LPCGUID pguidPrimaryProvider,
|
||||
LPCGUID rgguidInterfaces,
|
||||
DWORD dwInterfaceCount, LPCBYTE pbAtr,
|
||||
LPCBYTE pbAtrMask, DWORD cbAtrLen)
|
||||
{
|
||||
LLOGLN(0, ("SCardIntroduceCardTypeA:"));
|
||||
return aSCardIntroduceCardTypeA(hContext, szCardName, pguidPrimaryProvider,
|
||||
rgguidInterfaces, dwInterfaceCount, pbAtr,
|
||||
pbAtrMask, cbAtrLen);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardIntroduceCardTypeW(SCARDCONTEXT hContext, LPCWSTR szCardName,
|
||||
LPCGUID pguidPrimaryProvider, LPCGUID rgguidInterfaces,
|
||||
DWORD dwInterfaceCount, LPCBYTE pbAtr,
|
||||
LPCBYTE pbAtrMask, DWORD cbAtrLen)
|
||||
{
|
||||
LLOGLN(0, ("SCardIntroduceCardTypeW:"));
|
||||
return aSCardIntroduceCardTypeW(hContext, szCardName, pguidPrimaryProvider,
|
||||
rgguidInterfaces, dwInterfaceCount, pbAtr,
|
||||
pbAtrMask, cbAtrLen);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardSetCardTypeProviderNameA(SCARDCONTEXT hContext, LPCSTR szCardName,
|
||||
DWORD dwProviderId, LPCSTR szProvider)
|
||||
{
|
||||
LLOGLN(0, ("SCardSetCardTypeProviderNameA:"));
|
||||
return aSCardSetCardTypeProviderNameA(hContext, szCardName,
|
||||
dwProviderId, szProvider);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardSetCardTypeProviderNameW(SCARDCONTEXT hContext, LPCWSTR szCardName,
|
||||
DWORD dwProviderId, LPCWSTR szProvider)
|
||||
{
|
||||
LLOGLN(0, ("SCardSetCardTypeProviderNameW:"));
|
||||
return aSCardSetCardTypeProviderNameW(hContext, szCardName,
|
||||
dwProviderId, szProvider);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardForgetCardTypeA(SCARDCONTEXT hContext, LPCSTR szCardName)
|
||||
{
|
||||
LLOGLN(0, ("SCardForgetCardTypeA:"));
|
||||
return aSCardForgetCardTypeA(hContext, szCardName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardForgetCardTypeW(SCARDCONTEXT hContext, LPCWSTR szCardName)
|
||||
{
|
||||
LLOGLN(0, ("SCardForgetCardTypeW:"));
|
||||
return aSCardForgetCardTypeW(hContext, szCardName);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardFreeMemory(SCARDCONTEXT hContext, LPCVOID pvMem)
|
||||
{
|
||||
LLOGLN(0, ("SCardFreeMemory:"));
|
||||
return aSCardFreeMemory(hContext, pvMem);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardLocateCardsA(SCARDCONTEXT hContext, LPCSTR mszCards,
|
||||
LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders)
|
||||
{
|
||||
LLOGLN(0, ("SCardLocateCardsA:"));
|
||||
return aSCardLocateCardsA(hContext, mszCards, rgReaderStates, cReaders);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardLocateCardsW(SCARDCONTEXT hContext, LPCWSTR mszCards,
|
||||
LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders)
|
||||
{
|
||||
LLOGLN(0, ("SCardLocateCardsW:"));
|
||||
return aSCardLocateCardsW(hContext, mszCards, rgReaderStates, cReaders);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardGetStatusChangeA(SCARDCONTEXT hContext, DWORD dwTimeout,
|
||||
LPSCARD_READERSTATEA rgReaderStates,
|
||||
DWORD cReaders)
|
||||
{
|
||||
LLOGLN(0, ("SCardGetStatusChangeA:"));
|
||||
return aSCardGetStatusChangeA(hContext, dwTimeout, rgReaderStates, cReaders);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardGetStatusChangeW(SCARDCONTEXT hContext, DWORD dwTimeout,
|
||||
LPSCARD_READERSTATEW rgReaderStates,
|
||||
DWORD cReaders)
|
||||
{
|
||||
LLOGLN(0, ("SCardGetStatusChangeW:"));
|
||||
return aSCardGetStatusChangeW(hContext, dwTimeout, rgReaderStates, cReaders);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardCancel(SCARDCONTEXT hContext)
|
||||
{
|
||||
LLOGLN(0, ("SCardCancel:"));
|
||||
return aSCardCancel(hContext);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardConnectA(SCARDCONTEXT hContext, LPCSTR szReader, DWORD dwShareMode,
|
||||
DWORD dwPreferredProtocols, LPSCARDHANDLE phCard,
|
||||
LPDWORD pdwActiveProtocol)
|
||||
{
|
||||
LLOGLN(0, ("SCardConnectA:"));
|
||||
return aSCardConnectA(hContext, szReader, dwShareMode,
|
||||
dwPreferredProtocols, phCard,
|
||||
pdwActiveProtocol);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardConnectW(SCARDCONTEXT hContext, LPCWSTR szReader, DWORD dwShareMode,
|
||||
DWORD dwPreferredProtocols, LPSCARDHANDLE phCard,
|
||||
LPDWORD pdwActiveProtocol)
|
||||
{
|
||||
LLOGLN(0, ("SCardConnectW:"));
|
||||
return aSCardConnectW(hContext, szReader, dwShareMode,
|
||||
dwPreferredProtocols, phCard,
|
||||
pdwActiveProtocol);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardReconnect(SCARDHANDLE hCard, DWORD dwShareMode,
|
||||
DWORD dwPreferredProtocols, DWORD dwInitialization,
|
||||
LPDWORD pdwActiveProtocol)
|
||||
{
|
||||
LLOGLN(0, ("SCardReconnect:"));
|
||||
return SCardReconnect(hCard, dwShareMode, dwPreferredProtocols,
|
||||
dwInitialization, pdwActiveProtocol);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardDisconnect(SCARDHANDLE hCard, DWORD dwDisposition)
|
||||
{
|
||||
LLOGLN(0, ("SCardDisconnect:"));
|
||||
return aSCardDisconnect(hCard, dwDisposition);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardBeginTransaction(SCARDHANDLE hCard)
|
||||
{
|
||||
LLOGLN(0, ("SCardBeginTransaction:"));
|
||||
return aSCardBeginTransaction(hCard);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardEndTransaction(SCARDHANDLE hCard, DWORD dwDisposition)
|
||||
{
|
||||
LLOGLN(0, ("SCardEndTransaction:"));
|
||||
return aSCardEndTransaction(hCard, dwDisposition);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardCancelTransaction(SCARDHANDLE hCard)
|
||||
{
|
||||
LLOGLN(0, ("SCardCancelTransaction:"));
|
||||
return aSCardCancelTransaction(hCard);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardState(SCARDHANDLE hCard, LPDWORD pdwState, LPDWORD pdwProtocol,
|
||||
LPBYTE pbAtr, LPDWORD pcbAtrLen)
|
||||
{
|
||||
LLOGLN(0, ("SCardState:"));
|
||||
return aSCardState(hCard, pdwState, pdwProtocol, pbAtr, pcbAtrLen);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardStatusA(SCARDHANDLE hCard, LPSTR szReaderName, LPDWORD pcchReaderLen,
|
||||
LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr,
|
||||
LPDWORD pcbAtrLen)
|
||||
{
|
||||
LLOGLN(0, ("SCardStatusA:"));
|
||||
return aSCardStatusA(hCard, szReaderName, pcchReaderLen,
|
||||
pdwState, pdwProtocol, pbAtr, pcbAtrLen);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardStatusW(SCARDHANDLE hCard, LPWSTR szReaderName, LPDWORD pcchReaderLen,
|
||||
LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr,
|
||||
LPDWORD pcbAtrLen)
|
||||
{
|
||||
LONG rv;
|
||||
|
||||
LLOGLN(0, ("SCardStatusW:"));
|
||||
LLOGLN(0, (" cchReaderLen %d", *pcchReaderLen));
|
||||
LLOGLN(0, (" cbAtrLen %d", *pcbAtrLen));
|
||||
rv = aSCardStatusW(hCard, szReaderName, pcchReaderLen,
|
||||
pdwState, pdwProtocol, pbAtr, pcbAtrLen);
|
||||
LLOGLN(0, (" rv %d cchReaderLen %d", rv, *pcchReaderLen));
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardTransmit(SCARDHANDLE hCard, LPCSCARD_IO_REQUEST pioSendPci,
|
||||
LPCBYTE pbSendBuffer, DWORD cbSendLength,
|
||||
LPSCARD_IO_REQUEST pioRecvPci, LPBYTE pbRecvBuffer,
|
||||
LPDWORD pcbRecvLength)
|
||||
{
|
||||
LONG rv;
|
||||
|
||||
LLOGLN(10, ("SCardTransmit:"));
|
||||
LLOGLN(10, (" hCard %p", hCard));
|
||||
LLOGLN(10, (" cbSendLength %d", cbSendLength));
|
||||
LLOGLN(10, (" cbRecvLength %d", *pcbRecvLength));
|
||||
LLOGLN(10, (" pioSendPci->dwProtocol %d", pioSendPci->dwProtocol));
|
||||
LLOGLN(10, (" pioSendPci->cbPciLength %d", pioSendPci->cbPciLength));
|
||||
LLOGLN(10, (" pioRecvPci %p", pioRecvPci));
|
||||
if (pioRecvPci != NULL)
|
||||
{
|
||||
LLOGLN(10, (" pioRecvPci->dwProtocol %d", pioRecvPci->dwProtocol));
|
||||
LLOGLN(10, (" pioRecvPci->cbPciLength %d", pioRecvPci->cbPciLength));
|
||||
}
|
||||
rv = aSCardTransmit(hCard, pioSendPci, pbSendBuffer, cbSendLength,
|
||||
pioRecvPci, pbRecvBuffer, pcbRecvLength);
|
||||
LLOGLN(10, (" rv %d cbRecvLength %d", rv, *pcbRecvLength));
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardControl(SCARDHANDLE hCard, DWORD dwControlCode, LPCVOID lpInBuffer,
|
||||
DWORD nInBufferSize, LPVOID lpOutBuffer,
|
||||
DWORD nOutBufferSize, LPDWORD lpBytesReturned)
|
||||
{
|
||||
LONG rv;
|
||||
char text[8148];
|
||||
|
||||
LLOGLN(10, ("SCardControl:"));
|
||||
LLOGLN(10, (" hCard %p", hCard));
|
||||
LLOGLN(10, (" dwControlCode 0x%8.8x", dwControlCode));
|
||||
LLOGLN(10, (" lpInBuffer %p", lpInBuffer));
|
||||
LLOGLN(10, (" nInBufferSize %d", nInBufferSize));
|
||||
LLOGLN(10, (" lpOutBuffer %p", lpOutBuffer));
|
||||
LLOGLN(10, (" nOutBufferSize %d", nOutBufferSize));
|
||||
LLOGLN(10, (" lpBytesReturned %p", lpBytesReturned));
|
||||
rv = aSCardControl(hCard, dwControlCode,
|
||||
lpInBuffer, nInBufferSize,
|
||||
lpOutBuffer, nOutBufferSize,
|
||||
lpBytesReturned);
|
||||
LLOGLN(10, (" rv %d BytesReturned %d", rv, *lpBytesReturned));
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardGetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE pbAttr,
|
||||
LPDWORD pcbAttrLen)
|
||||
{
|
||||
LLOGLN(0, ("SCardGetAttrib:"));
|
||||
return aSCardGetAttrib(hCard, dwAttrId, pbAttr, pcbAttrLen);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
LONG WINAPI
|
||||
SCardSetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPCBYTE pbAttr,
|
||||
DWORD cbAttrLen)
|
||||
{
|
||||
LLOGLN(0, ("SCardSetAttrib:"));
|
||||
return aSCardSetAttrib(hCard, dwAttrId, pbAttr, cbAttrLen);
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
EXPORTS
|
||||
SCardEstablishContext
|
||||
SCardReleaseContext
|
||||
SCardIsValidContext
|
||||
SCardListReaderGroupsA
|
||||
SCardListReaderGroupsW
|
||||
SCardListReadersA
|
||||
SCardListReadersW
|
||||
SCardListCardsA
|
||||
SCardListCardsW
|
||||
SCardListInterfacesA
|
||||
SCardListInterfacesW
|
||||
SCardGetProviderIdA
|
||||
SCardGetProviderIdW
|
||||
SCardGetCardTypeProviderNameA
|
||||
SCardGetCardTypeProviderNameW
|
||||
SCardIntroduceReaderGroupA
|
||||
SCardIntroduceReaderGroupW
|
||||
SCardForgetReaderGroupA
|
||||
SCardForgetReaderGroupW
|
||||
SCardIntroduceReaderA
|
||||
SCardIntroduceReaderW
|
||||
SCardForgetReaderA
|
||||
SCardForgetReaderW
|
||||
SCardAddReaderToGroupA
|
||||
SCardAddReaderToGroupW
|
||||
SCardRemoveReaderFromGroupA
|
||||
SCardRemoveReaderFromGroupW
|
||||
SCardIntroduceCardTypeA
|
||||
SCardIntroduceCardTypeW
|
||||
SCardSetCardTypeProviderNameA
|
||||
SCardSetCardTypeProviderNameW
|
||||
SCardForgetCardTypeA
|
||||
SCardForgetCardTypeW
|
||||
SCardFreeMemory
|
||||
SCardLocateCardsA
|
||||
SCardLocateCardsW
|
||||
SCardGetStatusChangeA
|
||||
SCardGetStatusChangeW
|
||||
SCardCancel
|
||||
SCardConnectA
|
||||
SCardConnectW
|
||||
SCardReconnect
|
||||
SCardDisconnect
|
||||
SCardBeginTransaction
|
||||
SCardEndTransaction
|
||||
SCardState
|
||||
SCardStatusA
|
||||
SCardStatusW
|
||||
SCardTransmit
|
||||
SCardControl
|
||||
SCardGetAttrib
|
||||
SCardSetAttrib
|
@ -1,18 +1,17 @@
|
||||
#
|
||||
# build xrdp pulseaudio modules
|
||||
#
|
||||
|
||||
PULSE_DIR = /home/lk/pulseaudio-1.1
|
||||
CFLAGS = -Wall -O2 -I$(PULSE_DIR) -I$(PULSE_DIR)/src -DHAVE_CONFIG_H -fPIC
|
||||
|
||||
#PULSE_DIR=/home/jay/temp/pulseaudio-0.9.21
|
||||
#PULSE_DIR=/home/jay/pulseaudio-0.9.22
|
||||
#PULSE_DIR=/home/jay/pulseaudio-0.9.21
|
||||
PULSE_DIR=/home/jay/pulseaudio-2.0
|
||||
all: module-xrdp-sink.so module-xrdp-source.so
|
||||
|
||||
OBJS = module-xrdp-sink.o
|
||||
module-xrdp-sink.so: module-xrdp-sink.o
|
||||
$(CC) $(LDFLAGS) -shared -o module-xrdp-sink.so module-xrdp-sink.o
|
||||
|
||||
CFLAGS = -Wall -O2 -I$(PULSE_DIR) -I$(PULSE_DIR)/src -DHAVE_CONFIG_H -fPIC
|
||||
|
||||
all: module-xrdp-sink.so
|
||||
|
||||
module-xrdp-sink.so: $(OBJS)
|
||||
$(CC) $(LDFLAGS) -shared -o module-xrdp-sink.so $(OBJS)
|
||||
module-xrdp-source.so: module-xrdp-source.o
|
||||
$(CC) $(LDFLAGS) -shared -o module-xrdp-source.so module-xrdp-source.o
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS) module-xrdp-sink.so
|
||||
rm -f module-xrdp-sink.o module-xrdp-sink.so module-xrdp-source.o module-xrdp-source.so
|
||||
|
@ -0,0 +1,29 @@
|
||||
#ifndef foomodulenullsourcesymdeffoo
|
||||
#define foomodulenullsourcesymdeffoo
|
||||
|
||||
#include <pulsecore/core.h>
|
||||
#include <pulsecore/module.h>
|
||||
#include <pulsecore/macro.h>
|
||||
|
||||
#define pa__init module_xrdp_source_LTX_pa__init
|
||||
#define pa__done module_xrdp_source_LTX_pa__done
|
||||
#define pa__get_author module_xrdp_source_LTX_pa__get_author
|
||||
#define pa__get_description module_xrdp_source_LTX_pa__get_description
|
||||
#define pa__get_usage module_xrdp_source_LTX_pa__get_usage
|
||||
#define pa__get_version module_xrdp_source_LTX_pa__get_version
|
||||
#define pa__get_deprecated module_xrdp_source_LTX_pa__get_deprecated
|
||||
#define pa__load_once module_xrdp_source_LTX_pa__load_once
|
||||
#define pa__get_n_used module_xrdp_source_LTX_pa__get_n_used
|
||||
|
||||
int pa__init(pa_module*m);
|
||||
void pa__done(pa_module*m);
|
||||
int pa__get_n_used(pa_module*m);
|
||||
|
||||
const char* pa__get_author(void);
|
||||
const char* pa__get_description(void);
|
||||
const char* pa__get_usage(void);
|
||||
const char* pa__get_version(void);
|
||||
const char* pa__get_deprecated(void);
|
||||
pa_bool_t pa__load_once(void);
|
||||
|
||||
#endif
|
@ -0,0 +1,460 @@
|
||||
/***
|
||||
This file is part of PulseAudio.
|
||||
|
||||
Copyright 2004-2008 Lennart Poettering
|
||||
Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
|
||||
|
||||
PulseAudio is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published
|
||||
by the Free Software Foundation; either version 2 of the License,
|
||||
or (at your option) any later version.
|
||||
|
||||
PulseAudio is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with PulseAudio; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
USA.
|
||||
***/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
|
||||
#include <pulse/rtclock.h>
|
||||
#include <pulse/timeval.h>
|
||||
#include <pulse/xmalloc.h>
|
||||
|
||||
#include <pulsecore/core-util.h>
|
||||
#include <pulsecore/log.h>
|
||||
#include <pulsecore/macro.h>
|
||||
#include <pulsecore/modargs.h>
|
||||
#include <pulsecore/module.h>
|
||||
#include <pulsecore/rtpoll.h>
|
||||
#include <pulsecore/source.h>
|
||||
#include <pulsecore/thread-mq.h>
|
||||
#include <pulsecore/thread.h>
|
||||
|
||||
#include "module-xrdp-source-symdef.h"
|
||||
|
||||
PA_MODULE_AUTHOR("Laxmikant Rashinkar");
|
||||
PA_MODULE_DESCRIPTION("xrdp source");
|
||||
PA_MODULE_VERSION(PACKAGE_VERSION);
|
||||
PA_MODULE_LOAD_ONCE(FALSE);
|
||||
PA_MODULE_USAGE(
|
||||
"format=<sample format> "
|
||||
"channels=<number of channels> "
|
||||
"rate=<sample rate> "
|
||||
"source_name=<name of source> "
|
||||
"channel_map=<channel map> "
|
||||
"description=<description for the source> "
|
||||
"latency_time=<latency time in ms>");
|
||||
|
||||
#define DEFAULT_SOURCE_NAME "xrdp-source"
|
||||
#define DEFAULT_LATENCY_TIME 10
|
||||
#define MAX_LATENCY_USEC (PA_USEC_PER_SEC * 2)
|
||||
#define CHANSRV_PORT_STR "/tmp/.xrdp/xrdp_chansrv_audio_in_socket_%d"
|
||||
|
||||
struct userdata {
|
||||
pa_core *core;
|
||||
pa_module *module;
|
||||
pa_source *source;
|
||||
|
||||
pa_thread *thread;
|
||||
pa_thread_mq thread_mq;
|
||||
pa_rtpoll *rtpoll;
|
||||
|
||||
size_t block_size;
|
||||
|
||||
pa_usec_t block_usec;
|
||||
pa_usec_t timestamp;
|
||||
pa_usec_t latency_time;
|
||||
|
||||
/* xrdp stuff */
|
||||
int fd; /* UDS connection to xrdp chansrv */
|
||||
int display_num; /* X display number */
|
||||
int want_src_data;
|
||||
};
|
||||
|
||||
static const char* const valid_modargs[] = {
|
||||
"rate",
|
||||
"format",
|
||||
"channels",
|
||||
"source_name",
|
||||
"channel_map",
|
||||
"description",
|
||||
"latency_time",
|
||||
NULL
|
||||
};
|
||||
|
||||
static int get_display_num_from_display(char *display_text) ;
|
||||
|
||||
static int source_process_msg(pa_msgobject *o, int code, void *data,
|
||||
int64_t offset, pa_memchunk *chunk) {
|
||||
|
||||
struct userdata *u = PA_SOURCE(o)->userdata;
|
||||
|
||||
switch (code) {
|
||||
case PA_SOURCE_MESSAGE_SET_STATE:
|
||||
|
||||
if (PA_PTR_TO_UINT(data) == PA_SOURCE_RUNNING)
|
||||
u->timestamp = pa_rtclock_now();
|
||||
|
||||
break;
|
||||
|
||||
case PA_SOURCE_MESSAGE_GET_LATENCY: {
|
||||
pa_usec_t now;
|
||||
|
||||
now = pa_rtclock_now();
|
||||
*((pa_usec_t*) data) = u->timestamp > now ? u->timestamp - now : 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return pa_source_process_msg(o, code, data, offset, chunk);
|
||||
}
|
||||
|
||||
static void source_update_requested_latency_cb(pa_source *s) {
|
||||
struct userdata *u;
|
||||
|
||||
pa_source_assert_ref(s);
|
||||
u = s->userdata;
|
||||
pa_assert(u);
|
||||
|
||||
u->block_usec = pa_source_get_requested_latency_within_thread(s);
|
||||
}
|
||||
|
||||
static int data_get(struct userdata *u, pa_memchunk *chunk) {
|
||||
|
||||
int fd;
|
||||
int bytes;
|
||||
struct sockaddr_un s;
|
||||
char *data;
|
||||
char buf[11];
|
||||
unsigned char ubuf[10];
|
||||
|
||||
if (u->fd == 0) {
|
||||
/* connect to xrdp unix domain socket */
|
||||
fd = socket(PF_LOCAL, SOCK_STREAM, 0);
|
||||
memset(&s, 0, sizeof(s));
|
||||
s.sun_family = AF_UNIX;
|
||||
bytes = sizeof(s.sun_path) - 1;
|
||||
snprintf(s.sun_path, bytes, CHANSRV_PORT_STR, u->display_num);
|
||||
pa_log_debug("Trying to connect to %s", s.sun_path);
|
||||
|
||||
if (connect(fd, (struct sockaddr *) &s, sizeof(struct sockaddr_un)) != 0) {
|
||||
pa_log_debug("Connect failed");
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
pa_log("Connected ok, fd=%d", fd);
|
||||
pa_log_debug("###### connected to xrdp audio_in socket");
|
||||
u->fd = fd;
|
||||
}
|
||||
|
||||
data = (char *) pa_memblock_acquire(chunk->memblock);
|
||||
|
||||
if (!u->want_src_data) {
|
||||
char buf[12];
|
||||
|
||||
buf[0] = 0;
|
||||
buf[1] = 0;
|
||||
buf[2] = 0;
|
||||
buf[3] = 0;
|
||||
buf[4] = 11;
|
||||
buf[5] = 0;
|
||||
buf[6] = 0;
|
||||
buf[7] = 0;
|
||||
buf[8] = 1;
|
||||
buf[9] = 0;
|
||||
buf[10] = 0;
|
||||
|
||||
send(u->fd, buf, 11, 0);
|
||||
u->want_src_data = 1;
|
||||
pa_log_debug("###### started recording");
|
||||
}
|
||||
|
||||
/* ask for more data */
|
||||
buf[0] = 0;
|
||||
buf[1] = 0;
|
||||
buf[2] = 0;
|
||||
buf[3] = 0;
|
||||
buf[4] = 11;
|
||||
buf[5] = 0;
|
||||
buf[6] = 0;
|
||||
buf[7] = 0;
|
||||
buf[8] = 3;
|
||||
buf[9] = (unsigned char) chunk->length;
|
||||
buf[10] = (unsigned char) ((chunk->length >> 8) & 0xff);
|
||||
|
||||
send(u->fd, buf, 11, 0);
|
||||
|
||||
/* read length of data available */
|
||||
recv(u->fd, ubuf, 2, 0);
|
||||
bytes = ((ubuf[1] << 8) & 0xff00) | (ubuf[0] & 0xff);
|
||||
|
||||
if (bytes == 0) {
|
||||
pa_memblock_release(chunk->memblock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* get data */
|
||||
bytes = recv(u->fd, data, bytes, 0);
|
||||
|
||||
pa_memblock_release(chunk->memblock);
|
||||
|
||||
return bytes;
|
||||
}
|
||||
|
||||
static void thread_func(void *userdata) {
|
||||
struct userdata *u = userdata;
|
||||
|
||||
pa_assert(u);
|
||||
pa_thread_mq_install(&u->thread_mq);
|
||||
u->timestamp = pa_rtclock_now();
|
||||
|
||||
for (;;) {
|
||||
int ret;
|
||||
|
||||
/* Generate some null data */
|
||||
if (u->source->thread_info.state == PA_SOURCE_RUNNING) {
|
||||
pa_usec_t now;
|
||||
pa_memchunk chunk;
|
||||
|
||||
now = pa_rtclock_now();
|
||||
|
||||
if ((chunk.length = pa_usec_to_bytes(now - u->timestamp, &u->source->sample_spec)) > 0) {
|
||||
chunk.memblock = pa_memblock_new(u->core->mempool, (size_t) -1); /* or chunk.length? */
|
||||
chunk.index = 0;
|
||||
data_get(u, &chunk);
|
||||
pa_source_post(u->source, &chunk);
|
||||
pa_memblock_unref(chunk.memblock);
|
||||
u->timestamp = now;
|
||||
}
|
||||
|
||||
pa_rtpoll_set_timer_absolute(u->rtpoll, u->timestamp + u->latency_time * PA_USEC_PER_MSEC);
|
||||
} else {
|
||||
if (u->want_src_data)
|
||||
{
|
||||
/* we dont want source data anymore */
|
||||
char buf[12];
|
||||
|
||||
buf[0] = 0;
|
||||
buf[1] = 0;
|
||||
buf[2] = 0;
|
||||
buf[3] = 0;
|
||||
buf[4] = 11;
|
||||
buf[5] = 0;
|
||||
buf[6] = 0;
|
||||
buf[7] = 0;
|
||||
buf[8] = 2;
|
||||
buf[9] = 0;
|
||||
buf[10] = 0;
|
||||
|
||||
send(u->fd, buf, 11, 0);
|
||||
u->want_src_data = 0;
|
||||
pa_log_debug("###### stopped recording");
|
||||
}
|
||||
pa_rtpoll_set_timer_disabled(u->rtpoll);
|
||||
}
|
||||
|
||||
/* Hmm, nothing to do. Let's sleep */
|
||||
if ((ret = pa_rtpoll_run(u->rtpoll, TRUE)) < 0)
|
||||
goto fail;
|
||||
|
||||
if (ret == 0)
|
||||
goto finish;
|
||||
}
|
||||
|
||||
fail:
|
||||
/* If this was no regular exit from the loop we have to continue
|
||||
* processing messages until we received PA_MESSAGE_SHUTDOWN */
|
||||
pa_asyncmsgq_post(u->thread_mq.outq, PA_MSGOBJECT(u->core), PA_CORE_MESSAGE_UNLOAD_MODULE, u->module, 0, NULL, NULL);
|
||||
pa_asyncmsgq_wait_for(u->thread_mq.inq, PA_MESSAGE_SHUTDOWN);
|
||||
|
||||
finish:
|
||||
pa_log_debug("###### thread shutting down");
|
||||
}
|
||||
|
||||
int pa__init(pa_module *m) {
|
||||
struct userdata *u = NULL;
|
||||
pa_sample_spec ss;
|
||||
pa_channel_map map;
|
||||
pa_modargs *ma = NULL;
|
||||
pa_source_new_data data;
|
||||
uint32_t latency_time = DEFAULT_LATENCY_TIME;
|
||||
|
||||
pa_assert(m);
|
||||
|
||||
if (!(ma = pa_modargs_new(m->argument, valid_modargs))) {
|
||||
pa_log("Failed to parse module arguments.");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
#if 0
|
||||
ss = m->core->default_sample_spec;
|
||||
#else
|
||||
ss.format = PA_SAMPLE_S16LE;
|
||||
ss.rate = 22050;
|
||||
ss.channels = 2;
|
||||
#endif
|
||||
|
||||
map = m->core->default_channel_map;
|
||||
if (pa_modargs_get_sample_spec_and_channel_map(ma, &ss, &map, PA_CHANNEL_MAP_DEFAULT) < 0) {
|
||||
pa_log("Invalid sample format specification or channel map");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
m->userdata = u = pa_xnew0(struct userdata, 1);
|
||||
u->core = m->core;
|
||||
u->module = m;
|
||||
u->rtpoll = pa_rtpoll_new();
|
||||
pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll);
|
||||
|
||||
pa_source_new_data_init(&data);
|
||||
data.driver = __FILE__;
|
||||
data.module = m;
|
||||
pa_source_new_data_set_name(&data, pa_modargs_get_value(ma, "source_name", DEFAULT_SOURCE_NAME));
|
||||
pa_source_new_data_set_sample_spec(&data, &ss);
|
||||
pa_source_new_data_set_channel_map(&data, &map);
|
||||
//pa_proplist_sets(data.proplist, PA_PROP_DEVICE_DESCRIPTION, pa_modargs_get_value(ma, "description", "Null Input"));
|
||||
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_DESCRIPTION, pa_modargs_get_value(ma, "description", "xrdp Input"));
|
||||
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_CLASS, "abstract");
|
||||
|
||||
u->source = pa_source_new(m->core, &data, PA_SOURCE_LATENCY | PA_SOURCE_DYNAMIC_LATENCY);
|
||||
pa_source_new_data_done(&data);
|
||||
|
||||
if (!u->source) {
|
||||
pa_log("Failed to create source object.");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
u->latency_time = DEFAULT_LATENCY_TIME;
|
||||
if (pa_modargs_get_value_u32(ma, "latency_time", &latency_time) < 0) {
|
||||
pa_log("Failed to parse latency_time value.");
|
||||
goto fail;
|
||||
}
|
||||
u->latency_time = latency_time;
|
||||
|
||||
u->source->parent.process_msg = source_process_msg;
|
||||
u->source->update_requested_latency = source_update_requested_latency_cb;
|
||||
u->source->userdata = u;
|
||||
|
||||
pa_source_set_asyncmsgq(u->source, u->thread_mq.inq);
|
||||
pa_source_set_rtpoll(u->source, u->rtpoll);
|
||||
|
||||
pa_source_set_latency_range(u->source, 0, MAX_LATENCY_USEC);
|
||||
u->block_usec = u->source->thread_info.max_latency;
|
||||
|
||||
u->source->thread_info.max_rewind =
|
||||
pa_usec_to_bytes(u->block_usec, &u->source->sample_spec);
|
||||
|
||||
if (!(u->thread = pa_thread_new("null-source", thread_func, u))) {
|
||||
pa_log("Failed to create thread.");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
pa_source_put(u->source);
|
||||
|
||||
pa_modargs_free(ma);
|
||||
|
||||
u->display_num = get_display_num_from_display(getenv("DISPLAY"));
|
||||
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
if (ma)
|
||||
pa_modargs_free(ma);
|
||||
|
||||
pa__done(m);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
void pa__done(pa_module*m) {
|
||||
struct userdata *u;
|
||||
|
||||
pa_assert(m);
|
||||
|
||||
if (!(u = m->userdata))
|
||||
return;
|
||||
|
||||
if (u->source)
|
||||
pa_source_unlink(u->source);
|
||||
|
||||
if (u->thread) {
|
||||
pa_asyncmsgq_send(u->thread_mq.inq, NULL, PA_MESSAGE_SHUTDOWN, NULL, 0, NULL);
|
||||
pa_thread_free(u->thread);
|
||||
}
|
||||
|
||||
pa_thread_mq_done(&u->thread_mq);
|
||||
|
||||
if (u->source)
|
||||
pa_source_unref(u->source);
|
||||
|
||||
if (u->rtpoll)
|
||||
pa_rtpoll_free(u->rtpoll);
|
||||
|
||||
pa_xfree(u);
|
||||
}
|
||||
|
||||
static int get_display_num_from_display(char *display_text) {
|
||||
int index;
|
||||
int mode;
|
||||
int host_index;
|
||||
int disp_index;
|
||||
int scre_index;
|
||||
int display_num;
|
||||
char host[256];
|
||||
char disp[256];
|
||||
char scre[256];
|
||||
|
||||
if (display_text == NULL) {
|
||||
return 0;
|
||||
}
|
||||
memset(host, 0, 256);
|
||||
memset(disp, 0, 256);
|
||||
memset(scre, 0, 256);
|
||||
|
||||
index = 0;
|
||||
host_index = 0;
|
||||
disp_index = 0;
|
||||
scre_index = 0;
|
||||
mode = 0;
|
||||
|
||||
while (display_text[index] != 0) {
|
||||
if (display_text[index] == ':') {
|
||||
mode = 1;
|
||||
} else if (display_text[index] == '.') {
|
||||
mode = 2;
|
||||
} else if (mode == 0) {
|
||||
host[host_index] = display_text[index];
|
||||
host_index++;
|
||||
} else if (mode == 1) {
|
||||
disp[disp_index] = display_text[index];
|
||||
disp_index++;
|
||||
} else if (mode == 2) {
|
||||
scre[scre_index] = display_text[index];
|
||||
scre_index++;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
|
||||
host[host_index] = 0;
|
||||
disp[disp_index] = 0;
|
||||
scre[scre_index] = 0;
|
||||
display_num = atoi(disp);
|
||||
return display_num;
|
||||
}
|
@ -1,34 +1,77 @@
|
||||
|
||||
this is /etc/apt/sources.list
|
||||
I added the deb-src line
|
||||
--------------------------------------
|
||||
Building pulseaudio modules for xrdp
|
||||
--------------------------------------
|
||||
|
||||
----------------------
|
||||
deb http://packages.linuxmint.com/ maya main upstream import
|
||||
deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
|
||||
deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
|
||||
deb-src http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
|
||||
deb http://security.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
|
||||
deb http://archive.canonical.com/ubuntu/ precise partner
|
||||
deb http://packages.medibuntu.org/ precise free non-free
|
||||
o append the following line to /etc/apt/sources.list
|
||||
|
||||
#deb http://archive.getdeb.net/ubuntu precise-getdeb apps
|
||||
#deb http://archive.getdeb.net/ubuntu precise-getdeb games
|
||||
deb http://drbl.sourceforge.net/drbl-core drbl stable
|
||||
----------------------
|
||||
deb-src http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
|
||||
|
||||
do all this in a new directory
|
||||
this is what my /etc/apt/sources.list looks like
|
||||
|
||||
root
|
||||
sudo apt-get install dpkg-dev
|
||||
deb http://packages.linuxmint.com/ maya main upstream import
|
||||
deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
|
||||
deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
|
||||
deb http://security.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
|
||||
deb http://archive.canonical.com/ubuntu/ precise partner
|
||||
deb http://packages.medibuntu.org/ precise free non-free
|
||||
|
||||
non root
|
||||
apt-get source pulseaudio
|
||||
#deb http://archive.getdeb.net/ubuntu precise-getdeb apps
|
||||
#deb http://archive.getdeb.net/ubuntu precise-getdeb games
|
||||
deb http://drbl.sourceforge.net/drbl-core drbl stable
|
||||
deb-src http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
|
||||
|
||||
root
|
||||
sudo apt-get build-dep pulseaudio
|
||||
NOTE: If you get an error message that goes something like this:
|
||||
|
||||
cd pulseaudio-1.1
|
||||
E: You must put some 'source' URIs in your sources.list
|
||||
|
||||
non root
|
||||
dpkg-buildpackage -rfakeroot -uc -b
|
||||
try running the following command first:
|
||||
|
||||
apt-get source pulseaudio
|
||||
|
||||
o run these commands in your home directory
|
||||
|
||||
cd
|
||||
sudo apt-get install dpkg-dev
|
||||
apt-get source pulseaudio
|
||||
sudo apt-get build-dep pulseaudio
|
||||
|
||||
cd pulseaudio-1.1
|
||||
dpkg-buildpackage -rfakeroot -uc -b
|
||||
|
||||
o edit Makefile and point PULSE_DIR to ~/pulseaudio<version> dir
|
||||
|
||||
o run make; the outputs will be
|
||||
module-xrdp-sink.so
|
||||
module-xrdp-source.so
|
||||
|
||||
o sudo cp module-xrdp-sink.so /usr/lib/pulse-<version>/modules
|
||||
sudo cp module-xrdp-source.so /usr/lib/pulse-<version>/modules
|
||||
note: on a 64bit machine use lib64 instead of lib
|
||||
|
||||
o if you build xrdp with --enable-load_pulse_modules, then the above modules
|
||||
will get loaded automatically when xrdp starts. However if --enable-load_pulse_modules
|
||||
is not used, then you need to edit /etc/pulse/default.pa and insert the following
|
||||
two lines into it:
|
||||
|
||||
load-module module-xrdp-sink
|
||||
load-module module-xrdp-source
|
||||
|
||||
--------------------------------------
|
||||
To test sound/microphone redirection
|
||||
--------------------------------------
|
||||
|
||||
o install gnome sound recorder or your favorite sound recorder
|
||||
|
||||
o mplayer -ao pulse <audio file>
|
||||
|
||||
o sudo apt-get install pavucontrol
|
||||
|
||||
o in another window run pavucontrol and you should see xrdp-sink in use
|
||||
|
||||
o to enable pulseaudio log
|
||||
o edit /etc/pulse/daemon.conf and set
|
||||
log-target = syslog
|
||||
log-level = notice
|
||||
o pulseaudio --kill
|
||||
o log output will be in /var/log/syslog or /var/log/messages
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,11 +1,12 @@
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include "mainwindow.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication::setGraphicsSystem(QLatin1String("native"));
|
||||
QApplication a(argc, argv);
|
||||
MainWindow w;
|
||||
w.show();
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,95 @@
|
||||
/*
|
||||
Copyright 2005-2014 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
keyboard
|
||||
|
||||
*/
|
||||
|
||||
#include "rdp.h"
|
||||
#include "rdpkeyboard.h"
|
||||
#include "rdpkeyboardevdev.h"
|
||||
|
||||
#define LOG_LEVEL 1
|
||||
#define LLOGLN(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
|
||||
|
||||
extern DeviceIntPtr g_keyboard; /* in rdpmain.c */
|
||||
extern int g_shift_down; /* in rdpmain.c */
|
||||
extern int g_alt_down; /* in rdpmain.c */
|
||||
extern int g_ctrl_down; /* in rdpmain.c */
|
||||
extern int g_pause_spe; /* in rdpmain.c */
|
||||
extern int g_tab_down; /* in rdpmain.c */
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
rdpEnqueueKey(int type, int scancode)
|
||||
{
|
||||
int i;
|
||||
int n;
|
||||
EventListPtr rdp_events;
|
||||
xEvent *pev;
|
||||
|
||||
i = GetEventList(&rdp_events);
|
||||
n = GetKeyboardEvents(rdp_events, g_keyboard, type, scancode);
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
pev = (rdp_events + i)->event;
|
||||
mieqEnqueue(g_keyboard, (InternalEvent *)pev);
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
check_keysa(void)
|
||||
{
|
||||
if (g_ctrl_down != 0)
|
||||
{
|
||||
rdpEnqueueKey(KeyRelease, g_ctrl_down);
|
||||
g_ctrl_down = 0;
|
||||
}
|
||||
|
||||
if (g_alt_down != 0)
|
||||
{
|
||||
rdpEnqueueKey(KeyRelease, g_alt_down);
|
||||
g_alt_down = 0;
|
||||
}
|
||||
|
||||
if (g_shift_down != 0)
|
||||
{
|
||||
rdpEnqueueKey(KeyRelease, g_shift_down);
|
||||
g_shift_down = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
sendDownUpKeyEvent(int type, int x_scancode)
|
||||
{
|
||||
/* if type is keydown, send keyup + keydown */
|
||||
if (type == KeyPress)
|
||||
{
|
||||
rdpEnqueueKey(KeyRelease, x_scancode);
|
||||
rdpEnqueueKey(KeyPress, x_scancode);
|
||||
}
|
||||
else
|
||||
{
|
||||
rdpEnqueueKey(KeyRelease, x_scancode);
|
||||
}
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
/*
|
||||
Copyright 2013-2014 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
keyboard map for base rules
|
||||
|
||||
*/
|
||||
|
||||
#ifndef _RDPKEYBOARD_H
|
||||
#define _RDPKEYBOARD_H
|
||||
|
||||
#define MIN_KEY_CODE 8
|
||||
#define MAX_KEY_CODE 255
|
||||
#define NO_OF_KEYS ((MAX_KEY_CODE - MIN_KEY_CODE) + 1)
|
||||
#define GLYPHS_PER_KEY 2
|
||||
|
||||
#define RDPSCAN_Tab 15
|
||||
#define RDPSCAN_Return 28 /* ext is used to know KP or not */
|
||||
#define RDPSCAN_Control 29 /* ext is used to know L or R */
|
||||
#define RDPSCAN_Shift_L 42
|
||||
#define RDPSCAN_Slash 53
|
||||
#define RDPSCAN_Shift_R 54
|
||||
#define RDPSCAN_KP_Multiply 55
|
||||
#define RDPSCAN_Alt 56 /* ext is used to know L or R */
|
||||
#define RDPSCAN_Caps_Lock 58
|
||||
#define RDPSCAN_Pause 69
|
||||
#define RDPSCAN_Scroll_Lock 70
|
||||
#define RDPSCAN_KP_7 71 /* KP7 or home */
|
||||
#define RDPSCAN_KP_8 72 /* KP8 or up */
|
||||
#define RDPSCAN_KP_9 73 /* KP9 or page up */
|
||||
#define RDPSCAN_KP_4 75 /* KP4 or left */
|
||||
#define RDPSCAN_KP_6 77 /* KP6 or right */
|
||||
#define RDPSCAN_KP_1 79 /* KP1 or home */
|
||||
#define RDPSCAN_KP_2 80 /* KP2 or up */
|
||||
#define RDPSCAN_KP_3 81 /* KP3 or page down */
|
||||
#define RDPSCAN_KP_0 82 /* KP0 or insert */
|
||||
#define RDPSCAN_KP_Decimal 83 /* KP. or delete */
|
||||
#define RDPSCAN_89 89
|
||||
#define RDPSCAN_90 90
|
||||
#define RDPSCAN_LWin 91
|
||||
#define RDPSCAN_RWin 92
|
||||
#define RDPSCAN_Menu 93
|
||||
#define RDPSCAN_115 115
|
||||
#define RDPSCAN_126 126
|
||||
|
||||
void
|
||||
rdpEnqueueKey(int type, int scancode);
|
||||
void
|
||||
check_keysa(void);
|
||||
void
|
||||
sendDownUpKeyEvent(int type, int x_scancode);
|
||||
|
||||
#endif
|
@ -0,0 +1,300 @@
|
||||
/*
|
||||
Copyright 2005-2014 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
keyboard map for base rules
|
||||
|
||||
*/
|
||||
|
||||
#include "rdp.h"
|
||||
#include "rdpkeyboard.h"
|
||||
#include "rdpkeyboardbase.h"
|
||||
|
||||
extern DeviceIntPtr g_keyboard; /* in rdpmain.c */
|
||||
extern int g_shift_down; /* in rdpmain.c */
|
||||
extern int g_alt_down; /* in rdpmain.c */
|
||||
extern int g_ctrl_down; /* in rdpmain.c */
|
||||
extern int g_pause_spe; /* in rdpmain.c */
|
||||
extern int g_tab_down; /* in rdpmain.c */
|
||||
|
||||
#define LOG_LEVEL 1
|
||||
#define LLOGLN(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
|
||||
|
||||
#define XSCAN_Tab 23
|
||||
#define XSCAN_Return 36 /* above right shift */
|
||||
#define XSCAN_Control_L 37
|
||||
#define XSCAN_Shift_L 50
|
||||
#define XSCAN_slash 61
|
||||
#define XSCAN_Shift_R 62
|
||||
#define XSCAN_KP_Multiply 63
|
||||
#define XSCAN_Alt_L 64
|
||||
#define XSCAN_Caps_Lock 66 /* caps lock */
|
||||
#define XSCAN_Num_Lock 77 /* num lock */
|
||||
#define XSCAN_KP_7 79
|
||||
#define XSCAN_KP_8 80
|
||||
#define XSCAN_KP_9 81
|
||||
#define XSCAN_KP_4 83
|
||||
#define XSCAN_KP_6 85
|
||||
#define XSCAN_KP_1 87
|
||||
#define XSCAN_KP_2 88
|
||||
#define XSCAN_KP_3 89
|
||||
#define XSCAN_KP_0 90
|
||||
#define XSCAN_KP_Decimal 91
|
||||
/* "/ ?" on br keybaord */
|
||||
#define XSCAN_97 97 /* ------------------------------? */
|
||||
#define XSCAN_Enter 108 /* 104 */ /* on keypad */
|
||||
#define XSCAN_Control_R 109 /* 105 */
|
||||
#define XSCAN_KP_Divide 112 /* 106 */
|
||||
#define XSCAN_Print 111 /* 107 */
|
||||
#define XSCAN_Alt_R 113 /* 108 */
|
||||
#define XSCAN_Home 97 /* 110 */
|
||||
#define XSCAN_Up 98 /* 111 */
|
||||
#define XSCAN_Prior 99 /* 112 */
|
||||
#define XSCAN_Left 100 /* 113 */
|
||||
#define XSCAN_Right 102 /* 114 */
|
||||
#define XSCAN_End 103 /* 115 */
|
||||
#define XSCAN_Down 104 /* 116 */
|
||||
#define XSCAN_Next 105 /* 117 */
|
||||
#define XSCAN_Insert 106 /* 118 */
|
||||
#define XSCAN_Delete 107 /* 119 */
|
||||
#define XSCAN_Pause 110 /* 127 */
|
||||
/* . on br keypad */
|
||||
#define XSCAN_129 129 /* ------------------------------? */
|
||||
#define XSCAN_LWin 115 /* 133 */
|
||||
#define XSCAN_RWin 116 /* 134 */
|
||||
#define XSCAN_Menu 117 /* 135 */
|
||||
#define XSCAN_LMeta 156
|
||||
#define XSCAN_RMeta 156
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
KbdAddEvent_base(int down, int param1, int param2, int param3, int param4)
|
||||
{
|
||||
int rdp_scancode;
|
||||
int x_scancode;
|
||||
int is_ext;
|
||||
int is_spe;
|
||||
int type;
|
||||
|
||||
LLOGLN(10, ("KbdAddEvent_base: down=0x%x param1=0x%x param2=0x%x "
|
||||
"param3=0x%x param4=0x%x", down, param1, param2, param3, param4));
|
||||
if (g_keyboard == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
type = down ? KeyPress : KeyRelease;
|
||||
rdp_scancode = param3;
|
||||
is_ext = param4 & 256; /* 0x100 */
|
||||
is_spe = param4 & 512; /* 0x200 */
|
||||
x_scancode = 0;
|
||||
|
||||
switch (rdp_scancode)
|
||||
{
|
||||
case RDPSCAN_Caps_Lock: /* caps lock */
|
||||
case RDPSCAN_Shift_L: /* left shift */
|
||||
case RDPSCAN_Shift_R: /* right shift */
|
||||
case RDPSCAN_Scroll_Lock: /* scroll lock */
|
||||
x_scancode = rdp_scancode + MIN_KEY_CODE;
|
||||
|
||||
if (x_scancode > 0)
|
||||
{
|
||||
/* left or right shift */
|
||||
if ((rdp_scancode == RDPSCAN_Shift_L) ||
|
||||
(rdp_scancode == RDPSCAN_Shift_R))
|
||||
{
|
||||
g_shift_down = down ? x_scancode : 0;
|
||||
}
|
||||
rdpEnqueueKey(type, x_scancode);
|
||||
}
|
||||
break;
|
||||
|
||||
case RDPSCAN_Alt: /* left - right alt button */
|
||||
|
||||
if (is_ext)
|
||||
{
|
||||
x_scancode = XSCAN_Alt_R; /* right alt button */
|
||||
}
|
||||
else
|
||||
{
|
||||
x_scancode = XSCAN_Alt_L; /* left alt button */
|
||||
}
|
||||
|
||||
g_alt_down = down ? x_scancode : 0;
|
||||
rdpEnqueueKey(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_Tab: /* tab */
|
||||
|
||||
if (!down && !g_tab_down)
|
||||
{
|
||||
check_keysa(); /* leave x_scancode 0 here, we don't want the tab key up */
|
||||
}
|
||||
else
|
||||
{
|
||||
sendDownUpKeyEvent(type, XSCAN_Tab);
|
||||
}
|
||||
|
||||
g_tab_down = down;
|
||||
break;
|
||||
|
||||
case RDPSCAN_Control: /* left or right ctrl */
|
||||
|
||||
/* this is to handle special case with pause key sending control first */
|
||||
if (is_spe)
|
||||
{
|
||||
if (down)
|
||||
{
|
||||
g_pause_spe = 1;
|
||||
/* leave x_scancode 0 here, we don't want the control key down */
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
x_scancode = is_ext ? XSCAN_Control_R : XSCAN_Control_L;
|
||||
g_ctrl_down = down ? x_scancode : 0;
|
||||
rdpEnqueueKey(type, x_scancode);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case RDPSCAN_Pause: /* Pause or Num Lock */
|
||||
|
||||
if (g_pause_spe)
|
||||
{
|
||||
x_scancode = XSCAN_Pause;
|
||||
|
||||
if (!down)
|
||||
{
|
||||
g_pause_spe = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
x_scancode = g_ctrl_down ? XSCAN_Pause : XSCAN_Num_Lock;
|
||||
}
|
||||
|
||||
rdpEnqueueKey(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_Return: /* Enter or Return */
|
||||
x_scancode = is_ext ? XSCAN_Enter : XSCAN_Return;
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_Slash: /* / */
|
||||
x_scancode = is_ext ? XSCAN_KP_Divide : XSCAN_slash;
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_KP_Multiply: /* * on KP or Print Screen */
|
||||
x_scancode = is_ext ? XSCAN_Print : XSCAN_KP_Multiply;
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_KP_7: /* 7 or Home */
|
||||
x_scancode = is_ext ? XSCAN_Home : XSCAN_KP_7;
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_KP_8: /* 8 or Up */
|
||||
x_scancode = is_ext ? XSCAN_Up : XSCAN_KP_8;
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_KP_9: /* 9 or PgUp */
|
||||
x_scancode = is_ext ? XSCAN_Prior : XSCAN_KP_9;
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_KP_4: /* 4 or Left */
|
||||
x_scancode = is_ext ? XSCAN_Left : XSCAN_KP_4;
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_KP_6: /* 6 or Right */
|
||||
x_scancode = is_ext ? XSCAN_Right : XSCAN_KP_6;
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_KP_1: /* 1 or End */
|
||||
x_scancode = is_ext ? XSCAN_End : XSCAN_KP_1;
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_KP_2: /* 2 or Down */
|
||||
x_scancode = is_ext ? XSCAN_Down : XSCAN_KP_2;
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_KP_3: /* 3 or PgDn */
|
||||
x_scancode = is_ext ? XSCAN_Next : XSCAN_KP_3;
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_KP_0: /* 0 or Insert */
|
||||
x_scancode = is_ext ? XSCAN_Insert : XSCAN_KP_0;
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_KP_Decimal: /* . or Delete */
|
||||
x_scancode = is_ext ? XSCAN_Delete : XSCAN_KP_Decimal;
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_LWin: /* left win key */
|
||||
rdpEnqueueKey(type, XSCAN_LWin);
|
||||
break;
|
||||
|
||||
case RDPSCAN_RWin: /* right win key */
|
||||
rdpEnqueueKey(type, XSCAN_RWin);
|
||||
break;
|
||||
|
||||
case RDPSCAN_Menu: /* menu key */
|
||||
rdpEnqueueKey(type, XSCAN_Menu);
|
||||
break;
|
||||
|
||||
case RDPSCAN_89: /* left meta */
|
||||
rdpEnqueueKey(type, XSCAN_LMeta);
|
||||
break;
|
||||
|
||||
case RDPSCAN_90: /* right meta */
|
||||
rdpEnqueueKey(type, XSCAN_RMeta);
|
||||
break;
|
||||
|
||||
case RDPSCAN_115:
|
||||
rdpEnqueueKey(type, XSCAN_97); /* "/ ?" on br keybaord */
|
||||
break;
|
||||
|
||||
case RDPSCAN_126:
|
||||
rdpEnqueueKey(type, XSCAN_129); /* . on br keypad */
|
||||
break;
|
||||
|
||||
default:
|
||||
x_scancode = rdp_scancode + MIN_KEY_CODE;
|
||||
|
||||
if (x_scancode > 0)
|
||||
{
|
||||
LLOGLN(10, ("KbdAddEvent_base: rdp_scancode %d x_scancode %d",
|
||||
rdp_scancode, x_scancode));
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
Copyright 2013-2014 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
keyboard map for base rules
|
||||
|
||||
*/
|
||||
|
||||
#ifndef _RDPKEYBOARDBASE_H
|
||||
#define _RDPKEYBOARDBASE_H
|
||||
|
||||
void
|
||||
KbdAddEvent_base(int down, int param1, int param2, int param3, int param4);
|
||||
|
||||
#endif
|
@ -0,0 +1,300 @@
|
||||
/*
|
||||
Copyright 2005-2014 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
keyboard map for evdev rules
|
||||
|
||||
*/
|
||||
|
||||
#include "rdp.h"
|
||||
#include "rdpkeyboard.h"
|
||||
#include "rdpkeyboardevdev.h"
|
||||
|
||||
extern DeviceIntPtr g_keyboard; /* in rdpmain.c */
|
||||
extern int g_shift_down; /* in rdpmain.c */
|
||||
extern int g_alt_down; /* in rdpmain.c */
|
||||
extern int g_ctrl_down; /* in rdpmain.c */
|
||||
extern int g_pause_spe; /* in rdpmain.c */
|
||||
extern int g_tab_down; /* in rdpmain.c */
|
||||
|
||||
#define LOG_LEVEL 1
|
||||
#define LLOGLN(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
|
||||
|
||||
#define XSCAN_Tab 23
|
||||
#define XSCAN_Return 36 /* above right shift */
|
||||
#define XSCAN_Control_L 37
|
||||
#define XSCAN_Shift_L 50
|
||||
#define XSCAN_slash 61
|
||||
#define XSCAN_Shift_R 62
|
||||
#define XSCAN_KP_Multiply 63
|
||||
#define XSCAN_Alt_L 64
|
||||
#define XSCAN_Caps_Lock 66 /* caps lock */
|
||||
#define XSCAN_Num_Lock 77 /* num lock */
|
||||
#define XSCAN_KP_7 79
|
||||
#define XSCAN_KP_8 80
|
||||
#define XSCAN_KP_9 81
|
||||
#define XSCAN_KP_4 83
|
||||
#define XSCAN_KP_6 85
|
||||
#define XSCAN_KP_1 87
|
||||
#define XSCAN_KP_2 88
|
||||
#define XSCAN_KP_3 89
|
||||
#define XSCAN_KP_0 90
|
||||
#define XSCAN_KP_Decimal 91
|
||||
/* "/ ?" on br keybaord */
|
||||
#define XSCAN_97 97
|
||||
#define XSCAN_Enter 104 /* on keypad */
|
||||
#define XSCAN_Control_R 105
|
||||
#define XSCAN_KP_Divide 106
|
||||
#define XSCAN_Print 107
|
||||
#define XSCAN_Alt_R 108
|
||||
#define XSCAN_Home 110
|
||||
#define XSCAN_Up 111
|
||||
#define XSCAN_Prior 112
|
||||
#define XSCAN_Left 113
|
||||
#define XSCAN_Right 114
|
||||
#define XSCAN_End 115
|
||||
#define XSCAN_Down 116
|
||||
#define XSCAN_Next 117
|
||||
#define XSCAN_Insert 118
|
||||
#define XSCAN_Delete 119
|
||||
#define XSCAN_Pause 127
|
||||
/* . on br keypad */
|
||||
#define XSCAN_129 129
|
||||
#define XSCAN_LWin 133
|
||||
#define XSCAN_RWin 134
|
||||
#define XSCAN_Menu 135
|
||||
#define XSCAN_LMeta 156
|
||||
#define XSCAN_RMeta 156
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
KbdAddEvent_evdev(int down, int param1, int param2, int param3, int param4)
|
||||
{
|
||||
int rdp_scancode;
|
||||
int x_scancode;
|
||||
int is_ext;
|
||||
int is_spe;
|
||||
int type;
|
||||
|
||||
LLOGLN(10, ("KbdAddEvent_evdev: down=0x%x param1=0x%x param2=0x%x "
|
||||
"param3=0x%x param4=0x%x", down, param1, param2, param3, param4));
|
||||
if (g_keyboard == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
type = down ? KeyPress : KeyRelease;
|
||||
rdp_scancode = param3;
|
||||
is_ext = param4 & 256; /* 0x100 */
|
||||
is_spe = param4 & 512; /* 0x200 */
|
||||
x_scancode = 0;
|
||||
|
||||
switch (rdp_scancode)
|
||||
{
|
||||
case RDPSCAN_Caps_Lock: /* caps lock */
|
||||
case RDPSCAN_Shift_L: /* left shift */
|
||||
case RDPSCAN_Shift_R: /* right shift */
|
||||
case RDPSCAN_Scroll_Lock: /* scroll lock */
|
||||
x_scancode = rdp_scancode + MIN_KEY_CODE;
|
||||
|
||||
if (x_scancode > 0)
|
||||
{
|
||||
/* left or right shift */
|
||||
if ((rdp_scancode == RDPSCAN_Shift_L) ||
|
||||
(rdp_scancode == RDPSCAN_Shift_R))
|
||||
{
|
||||
g_shift_down = down ? x_scancode : 0;
|
||||
}
|
||||
rdpEnqueueKey(type, x_scancode);
|
||||
}
|
||||
break;
|
||||
|
||||
case RDPSCAN_Alt: /* left - right alt button */
|
||||
|
||||
if (is_ext)
|
||||
{
|
||||
x_scancode = XSCAN_Alt_R; /* right alt button */
|
||||
}
|
||||
else
|
||||
{
|
||||
x_scancode = XSCAN_Alt_L; /* left alt button */
|
||||
}
|
||||
|
||||
g_alt_down = down ? x_scancode : 0;
|
||||
rdpEnqueueKey(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_Tab: /* tab */
|
||||
|
||||
if (!down && !g_tab_down)
|
||||
{
|
||||
check_keysa(); /* leave x_scancode 0 here, we don't want the tab key up */
|
||||
}
|
||||
else
|
||||
{
|
||||
sendDownUpKeyEvent(type, XSCAN_Tab);
|
||||
}
|
||||
|
||||
g_tab_down = down;
|
||||
break;
|
||||
|
||||
case RDPSCAN_Control: /* left or right ctrl */
|
||||
|
||||
/* this is to handle special case with pause key sending control first */
|
||||
if (is_spe)
|
||||
{
|
||||
if (down)
|
||||
{
|
||||
g_pause_spe = 1;
|
||||
/* leave x_scancode 0 here, we don't want the control key down */
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
x_scancode = is_ext ? XSCAN_Control_R : XSCAN_Control_L;
|
||||
g_ctrl_down = down ? x_scancode : 0;
|
||||
rdpEnqueueKey(type, x_scancode);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case RDPSCAN_Pause: /* Pause or Num Lock */
|
||||
|
||||
if (g_pause_spe)
|
||||
{
|
||||
x_scancode = XSCAN_Pause;
|
||||
|
||||
if (!down)
|
||||
{
|
||||
g_pause_spe = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
x_scancode = g_ctrl_down ? XSCAN_Pause : XSCAN_Num_Lock;
|
||||
}
|
||||
|
||||
rdpEnqueueKey(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_Return: /* Enter or Return */
|
||||
x_scancode = is_ext ? XSCAN_Enter : XSCAN_Return;
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_Slash: /* / */
|
||||
x_scancode = is_ext ? XSCAN_KP_Divide : XSCAN_slash;
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_KP_Multiply: /* * on KP or Print Screen */
|
||||
x_scancode = is_ext ? XSCAN_Print : XSCAN_KP_Multiply;
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_KP_7: /* 7 or Home */
|
||||
x_scancode = is_ext ? XSCAN_Home : XSCAN_KP_7;
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_KP_8: /* 8 or Up */
|
||||
x_scancode = is_ext ? XSCAN_Up : XSCAN_KP_8;
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_KP_9: /* 9 or PgUp */
|
||||
x_scancode = is_ext ? XSCAN_Prior : XSCAN_KP_9;
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_KP_4: /* 4 or Left */
|
||||
x_scancode = is_ext ? XSCAN_Left : XSCAN_KP_4;
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_KP_6: /* 6 or Right */
|
||||
x_scancode = is_ext ? XSCAN_Right : XSCAN_KP_6;
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_KP_1: /* 1 or End */
|
||||
x_scancode = is_ext ? XSCAN_End : XSCAN_KP_1;
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_KP_2: /* 2 or Down */
|
||||
x_scancode = is_ext ? XSCAN_Down : XSCAN_KP_2;
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_KP_3: /* 3 or PgDn */
|
||||
x_scancode = is_ext ? XSCAN_Next : XSCAN_KP_3;
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_KP_0: /* 0 or Insert */
|
||||
x_scancode = is_ext ? XSCAN_Insert : XSCAN_KP_0;
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_KP_Decimal: /* . or Delete */
|
||||
x_scancode = is_ext ? XSCAN_Delete : XSCAN_KP_Decimal;
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
break;
|
||||
|
||||
case RDPSCAN_LWin: /* left win key */
|
||||
rdpEnqueueKey(type, XSCAN_LWin);
|
||||
break;
|
||||
|
||||
case RDPSCAN_RWin: /* right win key */
|
||||
rdpEnqueueKey(type, XSCAN_RWin);
|
||||
break;
|
||||
|
||||
case RDPSCAN_Menu: /* menu key */
|
||||
rdpEnqueueKey(type, XSCAN_Menu);
|
||||
break;
|
||||
|
||||
case RDPSCAN_89: /* left meta */
|
||||
rdpEnqueueKey(type, XSCAN_LMeta);
|
||||
break;
|
||||
|
||||
case RDPSCAN_90: /* right meta */
|
||||
rdpEnqueueKey(type, XSCAN_RMeta);
|
||||
break;
|
||||
|
||||
case RDPSCAN_115:
|
||||
rdpEnqueueKey(type, XSCAN_97); /* "/ ?" on br keybaord */
|
||||
break;
|
||||
|
||||
case RDPSCAN_126:
|
||||
rdpEnqueueKey(type, XSCAN_129); /* . on br keypad */
|
||||
break;
|
||||
|
||||
default:
|
||||
x_scancode = rdp_scancode + MIN_KEY_CODE;
|
||||
|
||||
if (x_scancode > 0)
|
||||
{
|
||||
LLOGLN(10, ("KbdAddEvent_evdev: rdp_scancode %d x_scancode %d",
|
||||
rdp_scancode, x_scancode));
|
||||
sendDownUpKeyEvent(type, x_scancode);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
Copyright 2013-2014 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
keyboard map for base rules
|
||||
|
||||
*/
|
||||
|
||||
#ifndef _RDPKEYBOARDEVDEV_H
|
||||
#define _RDPKEYBOARDEVDEV_H
|
||||
|
||||
void
|
||||
KbdAddEvent_evdev(int down, int param1, int param2, int param3, int param4);
|
||||
|
||||
#endif
|
@ -0,0 +1,154 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Laxmikant Rashinkar 2014
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* Routines to copy regions from framebuffer to shared memory
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
/* this should be before all X11 .h files */
|
||||
#include <xorg-server.h>
|
||||
|
||||
/* all driver need this */
|
||||
#include <xf86.h>
|
||||
#include <xf86_OSproc.h>
|
||||
|
||||
#include "rdp.h"
|
||||
#include "rdpDraw.h"
|
||||
#include "rdpClientCon.h"
|
||||
#include "rdpReg.h"
|
||||
|
||||
#define LOG_LEVEL 1
|
||||
#define LLOGLN(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
|
||||
|
||||
/******************************************************************************/
|
||||
static Bool
|
||||
rdpCapture0(RegionPtr in_reg, RegionPtr out_reg,
|
||||
void *src, int src_width, int src_height,
|
||||
int src_stride, int src_format,
|
||||
void *dst, int dst_width, int dst_height,
|
||||
int dst_stride, int dst_format, int max_rects)
|
||||
{
|
||||
BoxPtr prects;
|
||||
BoxRec rect;
|
||||
RegionRec reg;
|
||||
char *src_rect;
|
||||
char *dst_rect;
|
||||
int num_regions;
|
||||
int bytespp;
|
||||
int width;
|
||||
int height;
|
||||
int src_offset;
|
||||
int dst_offset;
|
||||
int bytes;
|
||||
int i;
|
||||
int j;
|
||||
Bool rv;
|
||||
|
||||
LLOGLN(10, ("rdpCapture0:"));
|
||||
|
||||
rv = TRUE;
|
||||
|
||||
rect.x1 = 0;
|
||||
rect.y1 = 0;
|
||||
rect.x2 = min(dst_width, src_width);
|
||||
rect.y2 = min(dst_height, src_height);
|
||||
rdpRegionInit(®, &rect, 0);
|
||||
rdpRegionIntersect(®, in_reg, ®);
|
||||
|
||||
num_regions = REGION_NUM_RECTS(®);
|
||||
|
||||
if (num_regions > max_rects)
|
||||
{
|
||||
num_regions = 1;
|
||||
prects = rdpRegionExtents(®);
|
||||
rdpRegionUninit(out_reg);
|
||||
rdpRegionInit(out_reg, prects, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
prects = REGION_RECTS(®);
|
||||
rdpRegionCopy(out_reg, ®);
|
||||
}
|
||||
|
||||
if ((src_format == XRDP_a8r8g8b8) && (dst_format == XRDP_a8r8g8b8))
|
||||
{
|
||||
bytespp = 4;
|
||||
|
||||
for (i = 0; i < num_regions; i++)
|
||||
{
|
||||
/* get rect to copy */
|
||||
rect = prects[i];
|
||||
|
||||
/* get rect dimensions */
|
||||
width = rect.x2 - rect.x1;
|
||||
height = rect.y2 - rect.y1;
|
||||
|
||||
/* point to start of each rect in respective memory */
|
||||
src_offset = rect.y1 * src_stride + rect.x1 * bytespp;
|
||||
dst_offset = rect.y1 * dst_stride + rect.x1 * bytespp;
|
||||
src_rect = src + src_offset;
|
||||
dst_rect = dst + dst_offset;
|
||||
|
||||
/* bytes per line */
|
||||
bytes = width * bytespp;
|
||||
|
||||
/* copy one line at a time */
|
||||
for (j = 0; j < height; j++)
|
||||
{
|
||||
memcpy(dst_rect, src_rect, bytes);
|
||||
src_rect += src_stride;
|
||||
dst_rect += dst_stride;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LLOGLN(0, ("rdpCapture0: unimp color conversion"));
|
||||
}
|
||||
rdpRegionUninit(®);
|
||||
return rv;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy an array of rectangles from one memory area to another
|
||||
*****************************************************************************/
|
||||
Bool
|
||||
rdpCapture(RegionPtr in_reg, RegionPtr out_reg,
|
||||
void *src, int src_width, int src_height,
|
||||
int src_stride, int src_format,
|
||||
void *dst, int dst_width, int dst_height,
|
||||
int dst_stride, int dst_format, int mode)
|
||||
{
|
||||
LLOGLN(10, ("rdpCapture:"));
|
||||
switch (mode)
|
||||
{
|
||||
case 0:
|
||||
return rdpCapture0(in_reg, out_reg,
|
||||
src, src_width, src_height,
|
||||
src_stride, src_format,
|
||||
dst, dst_width, dst_height,
|
||||
dst_stride, dst_format, 15);
|
||||
default:
|
||||
LLOGLN(0, ("rdpCapture: unimp mode"));
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
/**
|
||||
* xrdp: A Remote Desktop Protocol server.
|
||||
*
|
||||
* Copyright (C) Laxmikant Rashinkar 2014
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* Routines to copy regions from framebuffer to shared memory
|
||||
*/
|
||||
|
||||
Bool
|
||||
rdpCapture(RegionPtr in_reg, RegionPtr out_reg,
|
||||
void *src, int src_width, int src_height,
|
||||
int src_stride, int src_format,
|
||||
void *dst, int dst_width, int dst_height,
|
||||
int dst_stride, int dst_format,
|
||||
int mode);
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,87 @@
|
||||
/*
|
||||
Copyright 2014 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
/* this should be before all X11 .h files */
|
||||
#include <xorg-server.h>
|
||||
|
||||
/* all driver need this */
|
||||
#include <xf86.h>
|
||||
#include <xf86_OSproc.h>
|
||||
|
||||
#include <mipict.h>
|
||||
#include <picture.h>
|
||||
|
||||
#include "rdp.h"
|
||||
#include "rdpDraw.h"
|
||||
#include "rdpClientCon.h"
|
||||
#include "rdpReg.h"
|
||||
#include "rdpTrapezoids.h"
|
||||
|
||||
/******************************************************************************/
|
||||
#define LOG_LEVEL 1
|
||||
#define LLOGLN(_level, _args) \
|
||||
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
|
||||
|
||||
/******************************************************************************/
|
||||
static void
|
||||
rdpTrapezoidsOrg(PictureScreenPtr ps, rdpPtr dev,
|
||||
CARD8 op, PicturePtr pSrc, PicturePtr pDst,
|
||||
PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc,
|
||||
int ntrap, xTrapezoid *traps)
|
||||
{
|
||||
ps->Trapezoids = dev->Trapezoids;
|
||||
ps->Trapezoids(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntrap, traps);
|
||||
ps->Trapezoids = rdpTrapezoids;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
void
|
||||
rdpTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
|
||||
PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc,
|
||||
int ntrap, xTrapezoid *traps)
|
||||
{
|
||||
ScreenPtr pScreen;
|
||||
rdpPtr dev;
|
||||
PictureScreenPtr ps;
|
||||
BoxRec box;
|
||||
RegionRec reg;
|
||||
|
||||
LLOGLN(10, ("rdpTrapezoids:"));
|
||||
pScreen = pDst->pDrawable->pScreen;
|
||||
dev = rdpGetDevFromScreen(pScreen);
|
||||
dev->counts.rdpTrapezoidsCallCount++;
|
||||
miTrapezoidBounds(ntrap, traps, &box);
|
||||
box.x1 += pDst->pDrawable->x;
|
||||
box.y1 += pDst->pDrawable->y;
|
||||
box.x2 += pDst->pDrawable->x;
|
||||
box.y2 += pDst->pDrawable->y;
|
||||
rdpRegionInit(®, &box, 0);
|
||||
ps = GetPictureScreen(pScreen);
|
||||
/* do original call */
|
||||
rdpTrapezoidsOrg(ps, dev, op, pSrc, pDst, maskFormat, xSrc, ySrc,
|
||||
ntrap, traps);
|
||||
rdpClientConAddAllReg(dev, ®, pDst->pDrawable);
|
||||
rdpRegionUninit(®);
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
Copyright 2014 Jay Sorg
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef _RDPTRAPEZOIDS_H
|
||||
#define _RDPTRAPEZOIDS_H
|
||||
|
||||
void
|
||||
rdpTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
|
||||
PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc,
|
||||
int ntrap, xTrapezoid *traps);
|
||||
|
||||
#endif
|
@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -e /etc/X11/xrdp/xorg.conf ]; then
|
||||
echo "/etc/X11/xrdp/xorg.conf ok"
|
||||
else
|
||||
echo "/etc/X11/xrdp/xorg.conf missing, run"
|
||||
echo "sudo mkdir /etc/X11/xrdp"
|
||||
echo "sudo cp xrdpdev/xorg.conf /etc/X11/xrdp/"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -d $HOME/xorg-modules ]; then
|
||||
echo "found directory ok"
|
||||
else
|
||||
echo "creating directory"
|
||||
mkdir $HOME/xorg-modules
|
||||
mkdir $HOME/xorg-modules/drivers
|
||||
mkdir $HOME/xorg-modules/extensions
|
||||
mkdir $HOME/xorg-modules/input
|
||||
|
||||
cp /usr/lib/xorg/modules/libfb.so $HOME/xorg-modules/
|
||||
cp /usr/lib/xorg/modules/libint10.so $HOME/xorg-modules/
|
||||
cp /usr/lib/xorg/modules/libvbe.so $HOME/xorg-modules/
|
||||
|
||||
cp /usr/lib/xorg/modules/extensions/libdbe.so $HOME/xorg-modules/extensions/
|
||||
cp /usr/lib/xorg/modules/extensions/libdri.so $HOME/xorg-modules/extensions/
|
||||
cp /usr/lib/xorg/modules/extensions/libdri2.so $HOME/xorg-modules/extensions/
|
||||
cp /usr/lib/xorg/modules/extensions/libextmod.so $HOME/xorg-modules/extensions/
|
||||
cp /usr/lib/xorg/modules/extensions/libglx.so $HOME/xorg-modules/extensions/
|
||||
cp /usr/lib/xorg/modules/extensions/librecord.so $HOME/xorg-modules/extensions/
|
||||
|
||||
fi
|
||||
|
||||
make
|
||||
if test $? -ne 0
|
||||
then
|
||||
echo "make failed"
|
||||
exit 1
|
||||
fi
|
||||
make xinstall
|
||||
exec Xorg -modulepath $HOME/xorg-modules -config xrdp/xorg.conf -logfile /tmp/Xtmp.log -novtswitch -sharevts -noreset -ac vt7 :20
|
After Width: | Height: | Size: 98 KiB |
Loading…
Reference in new issue