| 26 | } |
| 27 | |
| 28 | LPTHREAD_START_ROUTINE CtrlRoutine::getAddress(void) { |
| 29 | /* |
| 30 | TODO: Currently caller should call findAddress before getAddress. Otherwise NULL will be returned. |
| 31 | Maybe it's better to remove the findAddress call (or make it a private method) and use below commented code |
| 32 | to find the address if address is NULL. |
| 33 | */ |
| 34 | /* |
| 35 | NOTE: The reason for commenting the below snippet code and forcing the caller to call the findAddress |
| 36 | before call getAddress is performance and speed. Becasue current approach will get the ctrl routine address first and then |
| 37 | the remote process open and start will happen. So if there is any prbolem (exception) in getting the ctrl routine address, |
| 38 | the remote process open will not fire. If we change the current approach, the findAddress method will not fire |
| 39 | until the remote process startRemoteThread method call. So the remote process open method will be called even we can't |
| 40 | find the ctrl routine address and send the signal. So current approach is better for performance and speed. |
| 41 | */ |
| 42 | /* |
| 43 | if (this->address == NULL) { |
| 44 | CtrlRoutine::findAddress(); |
| 45 | } |
| 46 | */ |
| 47 | return this->address; |
| 48 | } |
| 49 | |
| 50 | void CtrlRoutine::findAddress() { |
| 51 | if (this->address == NULL) { |