| 116 | { } |
| 117 | |
| 118 | unsigned int callback(unsigned int dataLength, const void* data, |
| 119 | unsigned int bufferLength, void* buffer) |
| 120 | { |
| 121 | if (stopped) |
| 122 | return 0; |
| 123 | |
| 124 | if (port->port_protocol < PROTOCOL_VERSION13 || port->port_type != rem_port::INET) |
| 125 | return 0; |
| 126 | |
| 127 | Reference r(*port); |
| 128 | |
| 129 | replyData = buffer; |
| 130 | replyLength = bufferLength; |
| 131 | |
| 132 | PACKET p; |
| 133 | p.p_operation = op_crypt_key_callback; |
| 134 | p.p_cc.p_cc_data.cstr_length = dataLength; |
| 135 | p.p_cc.p_cc_data.cstr_address = (UCHAR*) data; |
| 136 | p.p_cc.p_cc_reply = bufferLength; |
| 137 | port->send(&p); |
| 138 | |
| 139 | if (!sem.tryEnter(60)) |
| 140 | return 0; |
| 141 | |
| 142 | return replyLength; |
| 143 | } |
| 144 | |
| 145 | void wakeup(unsigned int wakeLength, const void* wakeData) |
| 146 | { |